Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Excluding module in EAR in JBOSS 7.1.1

Tags:

java

jboss7.x

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>
like image 388
Aaron Tan Avatar asked May 23 '13 18:05

Aaron Tan


1 Answers

EAR file always includes sub-modules like ejb-jar or war modules. You can exclude a default jboss module from these sub-modules in sub-deployment elements.
For example if your EAR has an ejb-jar module named ejbModule.jar, Try following content in jboss-deployment-structure.xml file to exclude java.xml.bind.api from it:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
    <exclusions>
        <module name="java.xml.bind.api" slot="main"/>
    </exclusions>
</deployment>
<sub-deployment name="ejbModule.jar">
    <exclusions>
        <module name="java.xml.bind.api"/>
    </exclusions>
</sub-deployment>
</jboss-deployment-structure>
like image 132
hyda Avatar answered Sep 28 '22 22:09

hyda