6 Replies Latest reply on Aug 28, 2013 5:02 AM by Yaguo Zhou

    Question about how "jboss-deployment-structure.xml" works

    markus78 Newbie

      I have a EAR which consists of a number of statless session beans and WAR's. These use log4j.jar which we have in the ear/lib directory , and to prevent JBoss  7 from adding a dependency to the server (modules) version of log4j I have to do this in my deployment-structure.xml

       

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure>
         <deployment>
           <exclusions>
             <module name="org.apache.log4j" />
           </exclusions>
         </deployment>
         <sub-deployment name="Web-SNAPSHOT.war">
           <exclusions>
             <module name="org.apache.log4j" />
           </exclusions>
         </sub-deployment>
         <sub-deployment name="XFire-SNAPSHOT.war">
           <exclusions>
             <module name="org.apache.log4j" />
           </exclusions>
         </sub-deployment>
      </jboss-deployment-structure>
      
      

       

      Why do I have to specify an exclusion in each subdeployment? Should not the "top" level exclusion make sure that nothing in my EAR uses the JBoss 7 modules version of log4j? Am I doing this wrong?

       

      BR

      /Markus