Reputation: 4314
Consider following structure of jboss-deployment-structure.xml
inside META-INF
of ear
<!-- Make sub deployments not isolated so they can see each others classes without a Class-Path entry (default is true) -->
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
<exclusions>
<module name="org.apache.xerces" />
</exclusions>
</deployment>
<sub-deployment name="mySubDeployment.war">
<exclusions>
<module name="org.apache.log4j" />
</exclusions>
<dependencies>
<system>
<paths>
<path name="com/sun/org/apache/xerces/internal/dom"/>
<path name="com/sun/org/apache/xerces/internal/xni"/>
<path name="com/sun/org/apache/xerces/internal/jaxp"/>
</paths>
</system>
</dependencies>
</sub-deployment>
Given that, I have excluded default org.apache.xerces
module from deployment (line#11) and deployed custom xercesImpl.jar
in APP-INF/lib
folder or ear. Also I have added path dependencies for mySubDeployment.war
sub-deployment.
From where classes of xerces will be loaded for mySubDeployment.war
? From the default com.apache.xerces
module of WildFly or custom jar deployed in APP-INF/lib
?
What is the exact meaning of adding path dependencies in sub-deployment? Will that ignore the exclusions (i.e. org.apache.xerces here) under main deployment?
Upvotes: 0
Views: 1150
Reputation: 17780
You shouldn't really need those paths. You'll also have to exclude xerces for each sub-deployment.
Also the APP-INF
directory is not a standard Java EE directory. You'll need to put libraries in the /lib
directory of your EAR.
Upvotes: 1