[jboss-jira] [JBoss JIRA] (WFLY-6865) org.jboss.modules.ModuleNotFoundException when setting annotations=true in jboss-deployment-structure.xml

Brad Maxwell (JIRA) issues at jboss.org
Fri Jul 22 00:00:01 EDT 2016


    [ https://issues.jboss.org/browse/WFLY-6865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13269060#comment-13269060 ] 

Brad Maxwell commented on WFLY-6865:
------------------------------------

The issue is if I have framework.ear which contains say an AbstractBean , and app1.ear declares a dependency on framework.ear , then app1.ear can see AbstractBean, as the dependency is ensuring the classes are available.  But if you change the flag of the module dependency from annotations=false to annotations=true it logs an error that deployment.framework.ear module does not exist.  So it seems like since it works if it is not told to scan for annotations but then fails if told to look for annotations.

> org.jboss.modules.ModuleNotFoundException when setting annotations=true in jboss-deployment-structure.xml
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: WFLY-6865
>                 URL: https://issues.jboss.org/browse/WFLY-6865
>             Project: WildFly
>          Issue Type: Bug
>          Components: Server
>    Affects Versions: 10.0.0.Final
>            Reporter: Brad Maxwell
>            Assignee: Jason Greene
>         Attachments: reproducer.zip
>
>
> {code}
> 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
> {code}
> 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)
> {code}
> 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
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list