module defined in jboss-deployment-structure.xml with fails to parse when annotations=true in JBoss EAP 7
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.0
Issue
- We have an EAR application with subdeployment Jars under root of EAR listed as modules under application.xml and a Jar with annotations that contained under the root folder of the EAR and we have it listed under the jboss-deployment-structure.xml as an inline module. We created the jandex and set annotations=true as per the documentation [1]
The deployment fails with missing dependencies when annotations=true is set :
10:42:56,061 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "application-exception-using-dynamic-module.ear")]) - failure description: {"WFLYCTL0180: Services with missing/unavailable dependencies" => ["jboss.deployment.subunit.\"application-exception-using-dynamic-module.ear\".\"application-exception-ejb.jar\".PARSE is missing [jboss.module.service.\"deployment.application-exception-api\".main]"]}
- The jboss-deployment-structure.xml file looks like:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<sub-deployment name="application-exception-ejb.jar">
<dependencies>
<module name="deployment.application-exception-api" annotations="true"/>
</dependencies>
</sub-deployment>
<module name="deployment.application-exception-jds.ear.application-exception-api.jar">
<resources>
<resource-root path="application-exception-api.jar"/>
</resources>
</module>
</jboss-deployment-structure>
- the application.xml file looks like:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd"
version="6">
<module>
<ejb>application-exception-ejb.jar</ejb>
</module>
</application>
- the ear-subdeployments-isolated property is set to true under the EE subsystem in standalone*.xml/domain.xml
Resolution
The bug will be resolved in next available cumulative patch for EAP 7.0 AND EAP 7.1 where JIRA is Content from issues.jboss.org is not included.JBEAP-13168 which fixes the deployment dependency error.
Note:
- We recommend to follow the JavaEE specification for packaging / classpath in order to eliminate migration efforts when moving an application between JavaEE containers and major versions where migration effort would be needed for container specific configurations. The JavaEE specification / portable configuration would one of these configurations:
(i) Jar with annotations should be referenced by other Jars in the MANIFEST.MF class-path if the dependent Jars in case that the Jar with annoations is in the EAR root
(ii) Jar with annotations should be placed under the EAR/lib folder rather than the root
Root Cause
There were errors with this and Content from issues.jboss.org is not included.JBEAP-13168 was created for the bug with deployment failing with Jandex and annotations="true"
The use-case does not comply with EAP 7 recommendations but should work where Jandex is applied on Jar with annotations used as inline module with annotations="true" on it's dependencies.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.