0 Replies Latest reply on Mar 29, 2017 11:21 AM by Not- a-bug

    classloading in WildFly

    Not- a-bug Newbie

      Consider following structure of jboss-deployment-structure.xml


          <!-- Make sub deployments not isolated so they can see each others classes without a Class-Path entry (default is true) -->
              <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
                  <module name="org.apache.xerces" />
          <sub-deployment name="mySubDeployment.war">
                  <module name="org.apache.log4j" />
                          <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"/>


      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?