我在其中一个Web服务客户端遇到一个奇怪的错误。错误消息是:
WARN org.apache.cxf.phase.PhaseInterceptorChain - be60c6d00a168d8f2eeadfdd572bf6d2 - 拦截器 {http://service.web.myws.com/} EventLogService#{http://service.web.myws.com/} writeEventRecord 抛出异常,现在解开java.lang.NullPointerException: 空
错误没有堆栈跟踪。有什么建议从哪里开始寻找错误原因?
我的Web服务部署在Tomcat上运行的CXF servlet上。我使用cxf 2.7.3版为多个应用程序生成了一个公共客户端。但是多个应用程序使用的是2.6.2版本。这是一个问题吗?
虽然我有多个应用程序使用相同的公共客户端,但我只在少数客户端上获得空指针。它们似乎也是随机的。在我的测试环境中,此错误时不时发生,有时我会收到此错误,有时它会起作用。但在生产方面,这已经有好几天了。
更新:毕竟我们能够得到一个堆栈跟踪:
09:51:45.980 [tomcat-http--49] WARN o.a.cxf.phase.PhaseInterceptorChain - e2b62aba0a168d7d1eef83f92b31397d - Interceptor for {http://service.web.myws.com/}EventLogService#{http://service.web.myws.com/}writeEventRecord has thrown exception, unwinding now
java.lang.NullPointerException: null
at org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor.handleMessage(SoapHeaderOutFilterInterceptor.java:43) ~[cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor.handleMessage(SoapHeaderOutFilterInterceptor.java:29) ~[cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:531) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:464) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:367) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:320) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:89) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134) [cxf-bundle-2.6.2.jar:2.6.2]
at com.sun.proxy.$Proxy100.writeEventRecord(Unknown Source) [na:na]
at com.myws.edi.client.EventLogClient.writeEventRecord(EventLogClient.java:71) [ElogServiceClient-2.2-20140729.232322-1.jar:na]
at com.edi.enrollment.web.service.EnrollmentServiceImpl.processEnrollment(EnrollmentServiceImpl.java:42) [EnrollmentServiceImpl.class:na]
at sun.reflect.GeneratedMethodAccessor505.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
at org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.jaxws.AbstractJAXWSMethodInvoker.invoke(AbstractJAXWSMethodInvoker.java:178) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.jaxws.JAXWSMethodInvoker.invoke(JAXWSMethodInvoker.java:64) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:75) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58) [cxf-bundle-2.6.2.jar:2.6.2]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_45]
at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_45]
at org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:107) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:211) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:213) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:154) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:130) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:221) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:141) [cxf-bundle-2.6.2.jar:2.6.2]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:647) [servlet-api.jar:na]
at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:197) [cxf-bundle-2.6.2.jar:2.6.2]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305) [catalina.jar:7.0.35.B]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) [catalina.jar:7.0.35.B]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222) [catalina.jar:7.0.35.B]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123) [catalina.jar:7.0.35.B]
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) [catalina.jar:7.0.35.B]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) [catalina.jar:7.0.35.B]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99) [catalina.jar:7.0.35.B]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936) [catalina.jar:7.0.35.B]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) [catalina.jar:7.0.35.B]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407) [catalina.jar:7.0.35.B]
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004) [tomcat-coyote.jar:7.0.35.B]
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589) [tomcat-coyote.jar:7.0.35.B]
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312) [tomcat-coyote.jar:7.0.35.B]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [na:1.7.0_45]
知道为什么Soap头拦截器抛出一个空指针?