升级到 2.2.10 后,CXF Web 服务将无法工作

发布于 2024-10-01 16:15:19 字数 2199 浏览 5 评论 0原文

将 OpenEJB 从 3.1.2(使用 CXF 2.0.9)升级到 OpenEJB 3.1.3(使用 CXF 2.2.10)后,基于 CXF 的 Web 服务在服务器端出现以下异常:

org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
    WARNING: Interceptor for {http://xxxxxx.com/wsdl}ProInfoMgmtWebService has thrown exception, unwinding now
    java.lang.NullPointerException
     at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:961)
     at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:949)
     at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:183)
     at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:71)
     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
     at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
     at org.apache.openejb.server.cxf.HttpDestination.invoke(HttpDestination.java:123)
     at org.apache.openejb.server.cxf.CxfWsContainer.processPOST(CxfWsContainer.java:106)
     at org.apache.openejb.server.cxf.CxfWsContainer.onMessage(CxfWsContainer.java:77)
     at org.apache.openejb.server.webservices.OpenEJBHttpWsRegistry$ClassLoaderHttpListener.onMessage(OpenEJBHttpWsRegistry.java:117)
     at org.apache.openejb.server.httpd.HttpListenerRegistry.onMessage(HttpListenerRegistry.java:43)
     at org.apache.openejb.server.httpd.OpenEJBHttpServer.process(OpenEJBHttpServer.java:176)
     at org.apache.openejb.server.httpd.OpenEJBHttpServer.processRequest(OpenEJBHttpServer.java:132)
     at org.apache.openejb.server.httpd.OpenEJBHttpServer.service(OpenEJBHttpServer.java:78)
     at org.apache.openejb.server.httpd.HttpEjbServer.service(HttpEjbServer.java:61)
     at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:91)
     at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:120)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     at java.lang.Thread.run(Thread.java:619)

看来这不是 OpenEJB 问题但仅限 CXF。 CXF 2.0.9 和 2.2.10 之间发生了什么变化导致此错误?

After upgrading OpenEJB from 3.1.2 (uses CXF 2.0.9) to OpenEJB 3.1.3 (uses CXF 2.2.10) CXF-based web-services are broken with the following exception on a server side:

org.apache.cxf.phase.PhaseInterceptorChain doDefaultLogging
    WARNING: Interceptor for {http://xxxxxx.com/wsdl}ProInfoMgmtWebService has thrown exception, unwinding now
    java.lang.NullPointerException
     at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:961)
     at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:949)
     at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:183)
     at org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.handleMessage(SAAJInInterceptor.java:71)
     at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:244)
     at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:110)
     at org.apache.openejb.server.cxf.HttpDestination.invoke(HttpDestination.java:123)
     at org.apache.openejb.server.cxf.CxfWsContainer.processPOST(CxfWsContainer.java:106)
     at org.apache.openejb.server.cxf.CxfWsContainer.onMessage(CxfWsContainer.java:77)
     at org.apache.openejb.server.webservices.OpenEJBHttpWsRegistry$ClassLoaderHttpListener.onMessage(OpenEJBHttpWsRegistry.java:117)
     at org.apache.openejb.server.httpd.HttpListenerRegistry.onMessage(HttpListenerRegistry.java:43)
     at org.apache.openejb.server.httpd.OpenEJBHttpServer.process(OpenEJBHttpServer.java:176)
     at org.apache.openejb.server.httpd.OpenEJBHttpServer.processRequest(OpenEJBHttpServer.java:132)
     at org.apache.openejb.server.httpd.OpenEJBHttpServer.service(OpenEJBHttpServer.java:78)
     at org.apache.openejb.server.httpd.HttpEjbServer.service(HttpEjbServer.java:61)
     at org.apache.openejb.server.ServicePool$2.run(ServicePool.java:91)
     at org.apache.openejb.server.ServicePool$3.run(ServicePool.java:120)
     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
     at java.lang.Thread.run(Thread.java:619)

It seems that it's not OpenEJB problem but CXF-only. What could have changed between CXF 2.0.9 and 2.2.10 to cause this error?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老街孤人 2024-10-08 16:15:19

有相关的错误 CXF-3170“StaxUtils.java:961 中的 NullPointerException”从12月6日开始。这似乎是完全相同的问题,作者知道原因:

这是由于我们在 jetty.xml 文件中配置 Jetty 和 CXF 的方式造成的,所以可以说这是我们的错。

您可能需要直接询问 CXF bug 的作者或者等待 CXF 的下一个版本修复此 bug,并要求 OpenEJB 开发人员升级 CXF。

There is the related bug CXF-3170 "NullPointerException in StaxUtils.java:961" from Dec 6th. It seems to be exactly the same problem and the author know the reason:

This is due to the way we configure Jetty and CXF in a jetty.xml file, so it our fault so to speak.

You are probably need to ask directly the author of the CXF bug OR wait for the next release of CXF where this bug will be fixed and ask OpenEJB developers to upgrade CXF.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文