Consider following structure of jboss-deployment-structure.xml
<jboss-deployment-structure> <!-- 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> </jboss-deployment-structure>
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 exlusions (i.e. org.apache.xerces here) under main deployment?