简体   繁体   中英

Jboss 7.2.2 Application Deployments issues

I am deploying 3 applications on same jboss 7.2.2 as mentioned below:

a.ear
    |+ META-INF
       |+ applications.xml and jboss-deployment-structure.xml
    |+ a.war
       |+ web pages and JSP /JSF pages
       |+ WEB-INF
          |+ web.xml, jboss-web.xml etc.
          |+ lib
             |+ tag library JARs
          |+ classes
             |+ servlets and other classes used by web pages
    |+ a.jar
       |+ EJB3 bean classes
       |+ META-INF
          |+ ejb-jar.xml and persistence.xml
    |+ lib
          |+ a1.jar, a2.jar etc.

b.ear - It is using some of the libraries generated from a.ear( a1.jar, a2.jar)
    |+ META-INF
       |+ applications.xml and jboss-deployment-structure.xml
    |+ b.war
       |+ web pages and JSP /JSF pages
       |+ WEB-INF
          |+ web.xml, jboss-web.xml etc.
          |+ lib
             |+ tag library JARs
          |+ classes
             |+ servlets and other classes used by web pages
    |+ b.jar
       |+ EJB3 bean classes
       |+ META-INF
          |+ ejb-jar.xml and persistence.xml
    |+ lib
          |+ a1.jar, a2.jar, b1.jar, b2.jar etc.

c.ear - It is using some of the libraries generated from a.ear and b.ear( a1.jar, a2.jar, b1.jar, b2.jar)
    |+ META-INF
       |+ applications.xml and jboss-deployment-structure.xml
    |+ c.war
       |+ web pages and JSP /JSF pages
       |+ WEB-INF
          |+ web.xml, jboss-web.xml etc.
          |+ lib
             |+ tag library JARs
          |+ classes
             |+ servlets and other classes used by web pages
    |+ c.jar
       |+ EJB3 bean classes
       |+ META-INF
          |+ ejb-jar.xml and persistence.xml
    |+ lib
          |+ a1.jar, a2.jar, b1.jar, b2.jar, c1.jar, c2.jar etc.

When I am deploying first two ears It is getting deployed successfully without any issues, But when I try to deploy c.ear its giving me same class cast exception due to multiple references of same APIs. I want jboss should only pick the jar's which I have given in ear lib folder and not from the deployments. How can I do that? How can I exclude this deployments(a.ear and b.ear) from jboss-deployment-structure?

Can you please help me to solve this?

I have resolved this issues with some alternate solution. I haven't found solution to exclude deployments classes.

Hello , You can use the JBoss Deployment Structure XML file to exclude Classes/Packages, you can use exclude path:

<exclude path="***" /> to exclude classes / packages. As well as <exclude-set>

Example:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
  <deployment>     
    <exclusions>
        <module name="sun.jdk" />
    </exclusions>   
    <dependencies>
        <module name="sun.jdk">
         <imports>
            <include-set>
                <path name="example/"/>
            </include-set>
            <exclude-set>
                <path name="path/"/>
            </exclude-set>
         </imports>
        </module>
    </dependencies>
  </deployment>
</jboss-deployment-structure>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM