在将 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 之间发生了什么变化会导致此错误?