Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-1668

org.jboss.modules.ModuleNotFoundException when setting annotations=true in jboss-deployment-structure.xml

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 3.0.0.Alpha4
    • None
    • Server
    • None
    • Hide

      A workaround is putting a jboss-all.xml in helloWorld2.ear/META-INF/ to make a blanket dependency on helloWorld.ear so that helloWorld2.ear is not started until after helloWorld.ear, but this should not be necessary:

      <jboss umlns="urn:jboss:1.0">
        <jboss-deployment-dependencies xmlns="urn:jboss:deployment-dependencies:1.0">
          <dependency name="helloWorld.ear" />
        </jboss-deployment-dependencies>
      </jboss>
      
      Show
      A workaround is putting a jboss-all.xml in helloWorld2.ear/META-INF/ to make a blanket dependency on helloWorld.ear so that helloWorld2.ear is not started until after helloWorld.ear, but this should not be necessary: <jboss umlns= "urn:jboss:1.0" > <jboss-deployment-dependencies xmlns= "urn:jboss:deployment-dependencies:1.0" > <dependency name= "helloWorld.ear" /> </jboss-deployment-dependencies> </jboss>

      helloWorld.ear 
       - helloWorld-ejb.jar
          - HelloBean - @Stateless EJB extends AbstractBean
       - lib 
        - helloWorld-api.jar
          - META-INF
            - jandex.idx
          - Hello - EJB interface
          - AbstractBean - abstract class which has @PostConstruct and implements Hello
      
      helloWorld2.ear
       - helloWorld2-ejb.jar
         - HelloBean2 - @Startup @Singleton extends AbstractBean
       - META-INF
        - jboss-deployment-structure.xml depends on deployment.helloWorld.ear export=true annotations=true
      

      To have HelloBean2 pickup the annotations on AbstractBean, jandex.idx was generate for the helloWorld-api.jar and then the j-d-s.xml file dependency has export=true so helloWorld2-ejb.jar sees the classes and annotations=true set to pull in the annotations.

      When annotations is not set or annotations=false the helloWorld2.ear deploys (but the @PostConstruct is not run since annotations are not enabled). When annotations=true is set, helloWorld2.ear fails to deploy with the exception below.

      It looks like the annotations handling is possibly out of order as the j-d-s.xml dependency should ensure the deployment.helloWorld.ear module is there (which it does when annotations=false, but when true it seems the module is not ready)

      19:44:44,659 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."helloWorld2.ear".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."helloWorld2.ear".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "helloWorld2.ear"
      	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:154)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: org.jboss.modules.ModuleNotFoundException: deployment.helloWorld.ear:main
      	at org.jboss.as.server.deployment.annotation.CompositeIndexProcessor.deploy(CompositeIndexProcessor.java:91)
      	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
      	... 5 more
      Caused by: org.jboss.modules.ModuleNotFoundException: deployment.helloWorld.ear:main
      	at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:223)
      	at org.jboss.as.server.deployment.annotation.CompositeIndexProcessor.deploy(CompositeIndexProcessor.java:81)
      	... 6 more
      

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              rhn-support-bmaxwell Brad Maxwell
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: