Bug 1358556 - [GSS](6.4.z) org.jboss.modules.ModuleNotFoundException when setting annotations=true in jboss-deployment-structure.xml
Summary: [GSS](6.4.z) org.jboss.modules.ModuleNotFoundException when setting annotatio...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Server
Version: 6.4.9
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: CR1
: EAP 6.4.11
Assignee: Radovan Netuka
QA Contact: Pavel Slavicek
eap-docs
URL:
Whiteboard:
Depends On:
Blocks: eap6411-payload
TreeView+ depends on / blocked
 
Reported: 2016-07-21 00:33 UTC by Brad Maxwell
Modified: 2019-11-14 08:46 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-17 13:14:12 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
reproducer (5.51 KB, application/octet-stream)
2016-07-21 00:41 UTC, Brad Maxwell
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBEAP-5336 0 Major Verified [GSS](7.0.z) org.jboss.modules.ModuleNotFoundException when setting annotations=true in jboss-deployment-structure.xml 2017-11-15 14:22:58 UTC
Red Hat Issue Tracker JBEAP-5698 0 Major Verified [GSS](7.1.0) org.jboss.modules.ModuleNotFoundException when setting annotations=true in jboss-deployment-structure.xml 2017-11-15 14:22:58 UTC
Red Hat Issue Tracker WFCORE-1668 0 Major Resolved org.jboss.modules.ModuleNotFoundException when setting annotations=true in jboss-deployment-structure.xml 2017-11-15 14:22:57 UTC

Description Brad Maxwell 2016-07-21 00:33:19 UTC
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:26:59,773 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC000001: Failed to start service jboss.deployment.unit."helloWorld2.ear".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."helloWorld2.ear".PARSE: JBAS018733: Failed to process phase PARSE of deployment "helloWorld2.ear"
	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-as-server-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.6.Final-redhat-1.jar:1.1.6.Final-redhat-1]
	at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.6.Final-redhat-1.jar:1.1.6.Final-redhat-1]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_101]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_101]
	at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_101]
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:83) [jboss-as-server-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
	... 5 more
Caused by: org.jboss.modules.ModuleNotFoundException: deployment.helloWorld.ear:main
	at org.jboss.modules.ModuleLoader.loadModule(ModuleLoader.java:240) [jboss-modules.jar:1.3.7.Final-redhat-1]
	at org.jboss.as.server.deployment.annotation.CompositeIndexProcessor.deploy(CompositeIndexProcessor.java:74) [jboss-as-server-7.5.9.Final-redhat-2.jar:7.5.9.Final-redhat-2]
	... 6 more


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>

Comment 1 Brad Maxwell 2016-07-21 00:41:09 UTC
Created attachment 1182302 [details]
reproducer

Reproducer , unzip the example.zip into the deployments dir and start JBOss

Comment 6 Ivo Hradek 2016-10-04 06:48:38 UTC
Verified with EAP 6.4.11.CP.CR1;

Comment 7 Petr Penicka 2017-01-17 13:14:12 UTC
Retroactively bulk-closing issues from released EAP 6.4 cummulative patches.

Comment 8 Petr Penicka 2017-01-17 13:15:26 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.


Note You need to log in before you can comment on or make changes to this bug.