如何从 Wildfly (Jboss) 访问 ws 端点的 CXF jar [英] How to access CXF jars from Wildfly (Jboss) for ws endpoints

查看:32
本文介绍了如何从 Wildfly (Jboss) 访问 ws 端点的 CXF jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在 Wildfly 8.2 中部署我的战争文件.我的应用程序将 org.apache.cxf 用于 Web 服务.但是 Wildfly (Jboss) 默认带有自己的 cxf jar,可以提供完整的 Java EE 支持.我可以通过

I've tried to deploy my war file in Wildfly 8.2. My application uses org.apache.cxf for web service. But Wildfly (Jboss) comes by default with its own cxf jars which can be provide full Java EE support. I could eliminate jboss cxf and utilise my own cxf jars for web services by

jboss-deployment-structure.xml

jboss-deployment-structure.xml

<jboss-deployment-structure>
    <deployment>
        <exclude-subsystems>
            <subsystem name="webservices" />
        </exclude-subsystems>
    </deployment>
</jboss-deployment-structure>

但它会禁用 jboss 对 ws 的支持,这意味着我什至无法在 Jboss 管理控制台中找到 ws 端点.但是我的客户需要利用 jboss 内置的 ws 功能,以便他可以随时禁用或启用任何 ws 调用.有谁知道如何配置我的应用程序以利用 jboss 的 cxf jar,以便我可以随时在 Jboss 管理控制台中调整我的 ws.以下链接解释了我迄今为止提到的完全相同的内容.我使用第一个选项成功,但我需要它来使用第二个选项.

But it'll disable ws support by jboss which means I can't even find ws endpoints in Jboss admin console. But my client needs to utilise jboss's build in ws features so that he can disable or enable any ws calls at any time. Does anyone know on how to configure my application to utilise jboss's cxf jars so that I can tune my ws in Jboss admin console at any time. The following link explains exactly the same which I've mentioned so far. I'm successfull with the first option, but I need it to work with second option.

http://cxf.apache.org/docs/应用服务器特定配置指南.html

注意:见第一个主题(JBoss 应用服务器)

Note: See the first topic ( JBoss Application Server )

我似乎不知道如何配置我的应用程序以使用 jboss 的 cxf jars..!

I can't seem to figure out how I can configure my application to utilise jboss's cxf jars..!

如果我从 build.gradle 文件中删除所有 org.apache.cxf 依赖项,它会给出 ClassNotFoundException 错误,这实际上告诉我它可以找到 cxf-transport jar.

If I remove all the org.apache.cxf dependencies from my build.gradle file, it give ClassNotFoundException error which infact tells me that it can find the cxf-transport jar.

Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: org.apache.cxf.transport.servlet.CXFServlet

如果我在 build.gradle 文件中包含 org.apache.cxf 依赖项,则表明它与 Jboss 中也存在的 cxf jar 冲突.整个问题是我需要通过消除用户定义的 cxf jar 来利用 jboss 中存在的 cxf 以获得完整的 Java EE 支持.

If I include org.apache.cxf dependenices in build.gradle file, it shows that it's conflicting with the cxf jar which is also present in Jboss. The whole problem is I need to utilise the cxf which is present in jboss for full Java EE support by eliminating the user defined cxf jars.

推荐答案

这可能与其他一些依赖项重叠,这意味着不同的版本.

This is probably overlap with some other dependency what implies different version.

我遇到了同样的情况,不得不测试并从 org.apache.cxf 中删除所有不合时宜的内容,尤其是已弃用的内容,例如:

I had the same situation and had to test and remove all un-nesesery ones from org.apache.cxf, especially deprecated ones like:

  • cxf-rt-rs-extension-providers,
  • cxf 分布清单,
  • cxf-bundle-jaxrs 和
  • cxf-rt-frontend-jaxrs.

对于所有用户使用 ${cxf.version} 以保持兼容性很重要org.apache.cxf,特别是对于更高版本,如果其他依赖项引入了旧的 cxf 库,请检查依赖项层次结构.

It is important for keeping compatibility to use ${cxf.version} for all org.apache.cxf, especialy for later versions and check the dependency hierarchy if other dependencies are bringing in older cxf libraries.

这篇关于如何从 Wildfly (Jboss) 访问 ws 端点的 CXF jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆