简体   繁体   English

从我的耳朵项目开始,如何使用Apache CXF 3.X和WSS4J 2.X,而不使用JBoss 6.3.0 EAP模块中安装的CXF和WSS4J(旧)?

[英]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. 在我们的Java应用程序中,我们必须使用apache CXF 3.0.0和WSS4j 2.1.1库。 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? 为了避免类加载器问题:从我的耳朵项目开始,如何使用Apache CXF 3.X和WSS4J 2.X,而不是JBoss 6.3.0 EAP模块中安装的CXF和WSS4J(旧)?

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. 由于JBoss类加载是模块化的,因此您可以创建jboss-deployment-structure.xml并在您的耳文件中排除与CXF和WSS4J相关的模块。 Please see this wiki page for reference. 请参阅此Wiki页面以供参考。 You can find the individual module names under the modules folder module.xml file. 您可以在modules文件夹下的module.xml文件中找到各个模块的名称。

For example to exclude CXF-server module: 例如,排除CXF服务器模块:

<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. 显然,您将需要确保pom.xml为CXF和WSS4J版本引入了所需的工件,并且未设置为提供的范围。 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). 另外,您可以创建自己的自定义JBoss模块文件夹,并在多个应用程序共享它们的情况下在其中添加库(有助于使EAR和WAR文件更小,并在容器中集中管理整个组织的依赖性)。 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. 请记住,打包您自己的库可能会中断支持,因为它们不是容器提供的实现位的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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