Class Loading issue when deploying Ear file.
bala260594 Feb 22, 2017 11:44 PMThe ear file is deployed successfully but the main.war file couldn't able to access classes form main.jar
Plugins.ear
|
|--a.jar
|--b.jar
|--c.jar
|--d.jar
|--main.jar
|--main.war
The main.war need to access the classes in the main.jar, the main.jar is dependent on a.jar, b.jar, c.jar, d.jar
application.xml
<?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"
version="6" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd">
<application-name>Plugins</application-name>
<initialize-in-order>true</initialize-in-order>
<module>
<ejb>main.jar</ejb>
</module>
<module>
<web>
<web-uri>main.war</web-uri>
<context-root>/main</context-root>
</web>
</module>
</application>
jboss-deployment-structure.xml
<jboss-deployment-structure>
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<exclusions>
<module name="deployment.Plugins.ear.a.jar" />
<module name="deployment.Plugins.ear.b.jar" />
<module name="deployment.Plugins.ear.c.jar" />
<module name="deployment.Plugins.ear.d.jar" />
<module name="deployment.Plugins.ear.main.jar" />
</exclusions>
<dependencies>
<module name="deployment.Plugins.ear.main.jar" export="true" />
</dependencies>
</deployment>
<sub-deployment name="testwebapp.war">
<dependencies>
<module name="deployment.Plugins.ear.a.jar"/>
<module name="deployment.Plugins.ear.b.jar"/>
<module name="deployment.Plugins.ear.c.jar"/>
<module name="deployment.Plugins.ear.d.jar" />
<module name="deployment.Plugins.ear.main.jar" />
</dependencies>
</sub-deployment>
</jboss-deployment-structure>
I suspect the main.jar is deploying in different classloader and main.war is deployed in other classloader, this ear file is deployed successfully in jboss 6, I encountered this issues from jboss 7 because of module classloading mechanism. Kindly help me out to solve this issue, Thanks in advance