简体   繁体   中英

How can I use Apache CXF 3.X and WSS4J 2.X as of my ear project and not CXF and WSS4J (older) that is installed in the modules of JBoss 6.3.0 EAP?

In our java application we have to use apache CXF 3.0.0 and WSS4j 2.1.1 libraries. To avoid classloader problems: How can I use Apache CXF 3.X and WSS4J 2.X as of my ear project and not CXF and WSS4J (older) that is installed in the modules of JBoss 6.3.0 EAP?

Since JBoss class loading is modular, you can create a jboss-deployment-structure.xml and exclude the CXF and WSS4J related modules in your ear file. Please see this wiki page for reference. You can find the individual module names under the modules folder module.xml file.

For example to exclude CXF-server module:

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
      <deployment>
        <exclusions>
          <module name="org.jboss.ws.cxf.jbossws-cxf-server"/>
        </exclusions>
      </deployment>
</jboss-deployment-structure>

You will obviously need to make sure your pom.xml is pulling in the desired artifacts for your CXF and WSS4J versions and not set to provided scope. Alternatively you can create your own custom JBoss module folder and add the libraries there if they will be shared by more than one application (helps keep your EAR and WAR files smaller and manage dependencies across the organization centrally in the container). In that case you can set it to provided scope.

Please keep in mind that packaging your own libraries will probably break support since they are not part of the container provided implementation bits.

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