Reputation: 303
I am deploying ear on jboss-as-7, it has two ejb jars and one war file. Below is the structure of application.xml file.
<module>
<ejb>ejb1.jar</ejb>
</module>
<module>
<web>
<web-uri>web1.war</web-uri>
<context-root>root/test</context-root>
</web>
</module>
<module>
<ejb>ejb2.jar</ejb>
</module>
This ear deployment requires external library dependency so I have added dependency in jboss-deployment-structure.xml file.
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
<ear-subdeployments-isolated>true</ear-subdeployments-isolated>
<deployment>
<dependencies>
<module name="deployment.local.fwk" export="true"/>
</dependencies>
</deployment>
<module name="deployment.local.fwk">
<resources>
<resource-root path="myclasses.jar"/>
</resources>
</module>
</jboss-deployment-structure>
I have this jar file in module/local/fwk folder. I am not sure what is missing here, while deploying I am getting NoClassDefFoundError for classes which are present in myclasses.jar.
Upvotes: 2
Views: 4857
Reputation: 18642
Detailed documentation of how the classes are loaded is specified at
https://docs.jboss.org/author/display/AS71/Class+Loading+in+AS7
Since you set the ear-subdeployments-isolated to true, did you set Class-Path entry in the Manifest file.
"If the ear-subdeployments-isolated is set to true then no automatic module dependencies between the sub-deployments are set up. User must manually setup the dependency with Class-Path entries, or by setting up explicit module dependencies."
Upvotes: 1