3 Replies Latest reply on May 29, 2013 3:31 AM by swd847

    Why doesn't my exclusion work?

    gazebo888

      I am trying to exclude the modules in JBOSS 7.1.1 and it seems like JBOSS just ignores my jboss-deployment-structure.xml. I have placed this in the META-INF of my EAR. Here's an example of my config file:

       

      <?xml version="1.0" encoding="UTF-8"?>
      <jboss-deployment-structure>
        
      <deployment>
             
      <exclusions>
                   
      <module name="java.xml.bind.api" /> <!- still see it there -->
                   
      <module name="somerandomname" /> <!- does not even complain when this doesn't exist -->
               
      </exclusions>
        
      </deployment>
      </jboss-deployment-structure>

       

      Any help wil be appreciated. Thanks.

        • 1. Re: Why doesn't my exclusion work?
          sfcoy

          I don't know why JBoss does not complain about non-existent modules, but I highly recommend that you do not try to exclude JAXB. There be many dragons that way.

           

          You're far better off making your code JAXB 2.1/2.2 compliant.

          • 2. Re: Why doesn't my exclusion work?
            jaikiran

            I think your jboss-deployment-structure.xml isn't being picked up. Or maybe we don't complain about non-existent modules in the exclusions section (I'll have to check the code) - which would make sense, since I don't see a point why we should complain when the module is being asked to be excluded anyway. What's the output of:

             

            jar -tf myear.ear

            • 3. Re: Why doesn't my exclusion work?
              swd847

              The problem is that exlusions only work for direct module dependencies, they don't for for indirect dependencies when a module is re-exported from another module.

               

              In this case the culprit is the javaee.api module, which is added by default and exports the java.xml.bind.api module. If you exclude this module as well then it should work (you may have to manually add some of the other modules that are imported from javaee.api).

               

              In wildfly upstream javaee.api is not added to deployments by default, so this should work as expected.