How to specify a dependency on a JBoss Module in JBoss EAP 8 / 7 / 6
Issue
- How to specify a dependency on a JBoss Module in JBoss EAP 6
- Dependencies in MANIFEST.MF in JBoss EAP 6
- Referring to jar file from modules. We have a jar file which has to be referenced from modules ($JBOSS_HOME/modules/test/api/main/xx.jar) and not from WEB-INF/lib of EAR application. Therefore added
Dependencies: test.api
inMANIFEST.MF
and below code injboss-deployment-structure.xml
. HoweverClassNotFoundException
is thrown at runtime. How this can be achieved. Jar file has to be in modules as this is required for other dependencies.
<?xml version="1.0"?>
<deployment>
<dependencies>
<module name="test.api"/>
</dependencies>
</deployment>
- How to declare a dependency on a JBoss module in JBoss EAP 6?
- I created com/mysql/main under modules and placed the mysql-connector-java-5.1.35-bin.jar in there. I created a module.xml file with these contents and put that in the same directory, still When I run my application on the server it says that it can not find the driver.:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="com.mysql">
<resources>
<resource-root path="mysql-connector-java-5.1.35-bin.jar" />
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 8.x
- 7.x
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.