一个名为“XXX”的组件已经在 JBoss 7.1.1 的此模块中定义

2022-09-01 12:39:42

我没有在我的应用程序中创建弹簧豆名称。但是,由于 的引发异常已在此模块中定义。我不知道问题出在哪里。我错过了什么?我需要做什么?TimerServiceDispatcherJBossTimerServiceDispatcher

我的应用程序使用Seam 2.3,Spring 3.0和JPA 2.0。我不使用.EJB

11:29:01,531 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "MRBS.war"
11:29:04,217 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC00001: Failed to start service jboss.deployment.unit."MRBS.war".PARSE: org.jboss.msc.service.StartExcept
ion in service jboss.deployment.unit."MRBS.war".PARSE: Failed to process phase PARSE of deployment "MRBS.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_23]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_23]
    at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_23]
Caused by: java.lang.IllegalArgumentException: JBAS011046: A component named 'TimerServiceDispatcher' is already defined in this module
    at org.jboss.as.ee.component.EEModuleDescription.addComponent(EEModuleDescription.java:137)
    at org.jboss.as.ejb3.deployment.processors.EJBComponentDescriptionFactory.addComponent(EJBComponentDescriptionFactory.java:60)
    at org.jboss.as.ejb3.deployment.processors.SessionBeanComponentDescriptionFactory.processSessionBeans(SessionBeanComponentDescriptionFactory.java:157)
    at org.jboss.as.ejb3.deployment.processors.SessionBeanComponentDescriptionFactory.processAnnotations(SessionBeanComponentDescriptionFactory.java:86)
    at org.jboss.as.ejb3.deployment.processors.AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.processAnnotations(AnnotatedEJBComponentDescriptionDeploymentUnitProcessor.java:
58)
    at org.jboss.as.ejb3.deployment.processors.AbstractDeploymentUnitProcessor.deploy(AbstractDeploymentUnitProcessor.java:81)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 5 more

11:29:04,230 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015870: Deploy of deployment "MRBS.war" was rolled back with failure message {"JBAS014671: Failed servi
ces" => {"jboss.deployment.unit.\"MRBS.war\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"MRBS.war\".PARSE: Failed to process phase PARSE of d
eployment \"MRBS.war\""}}
11:29:04,292 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-6) JBAS015877: Stopped deployment MRBS.war in 61ms
11:29:04,294 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.unit."MRBS.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."MRBS.war".
PARSE: Failed to process phase PARSE of deployment "MRBS.war"

jboss-deployment-structure.xml

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
  <deployment>
      <dependencies>
          <module name="org.hibernate" export="true"/>
          <module name="javax.faces.api" export="true" />
          <module name="com.sun.jsf-impl" export="true"/>
          <module name="org.dom4j" export="true"/>
          <module name="org.hibernate.validator" export="true"/>
        </dependencies>
        <exclusions>
            <module name="org.apache.log4j" />
        </exclusions>       
  </deployment>  
</jboss-deployment-structure> 

发展结构

MRBS.war
    -index.html
    +web-page-pakage
    +META-INF
    +WEB-INF
        +classes
        +lib
           aopalliance.jar
            commons-beanutils.jar
            commons-codec.jar
            commons-lang-2.5.jar
            drools-compiler.jar
            drools-core.jar
            drools-decisiontables.jar
            drools-templates.jar
            eclipselink.jar
            el-api.jar
            guava.jar
            guice.jar
            hibernate-ehcache.jar
            httpclient.jar
            httpcore.jar
            javax.persistence_2.0.1.v201006031150.jar
            jboss-el.jar
            jboss-seam-debug.jar
            jboss-seam-excel.jar
            jboss-seam-ioc.jar
            jboss-seam-mail.jar
            jboss-seam-pdf.jar
            jboss-seam-ui.jar
            jboss-seam.jar
            junit-4.8.1.jar
            log4j-1.2.14.jar
            mysql-connector-java-5.1.6-bin.jar
            primefaces-3.3.1.jar
            sac.jar
            spring-aop.jar
            spring-asm.jar
            spring-beans.jar
            spring-context.jar
            spring-core.jar
            spring-expression.jar
            spring-jdbc.jar
            spring-orm.jar
            spring-tx.jar
            spring-web.jar
            urlrewritefilter.jar
            xercesImpl.jar
            xml-apis.jar
        -components.xml     
        -faces-config.xml
        -jboss-deployment-structure.xml
        -pages.xml
        -web.xml

答案 1

我有一个用@Singleton和@Stateless注释的豆子触发了这个错误。我的代码当然是错误的,但是像这样的消息和帖子在一段时间内引导我走上了错误的道路。


答案 2

我知道这个问题的答案。由于我的固执,我花了几个星期与JBoss支持。他们计划通过EAP 6.2.x版本提供修复或至少更好的消息传递。

EJB 注释预处理器出现了问题 - 它带走了你的战争,并将库编译到其中并扫描它们以查找 EJB 注释。某些 Jar 文件可以在清单中包含“类路径:”的条目。(或者其他任何东西,但以“.”作为条目之一)。这会导致注释预处理器再次愚蠢地处理 web-inf lib 中的所有 jar 文件。最后,它将转到一个jar文件,其中包含它已经看到的EJB注释,因为它已经被之前处理过 - 这会导致它抱怨“一个名为xxx的组件已经定义”。

因此,这里最令人沮丧的部分是,它可能是一些您甚至不关心的旧jar文件,其中包含此不必要的Classpath清单条目 - 并导致JBoss自行递归。


推荐