CXF:方法被调用两次 - 拦截器异常

时间:2016-06-24 07:39:26

标签: java web-services jetty cxf

我已经使用Apache CXF编写了一个Web服务来捆绑对DB2数据库的访问。此服务由另一个Web服务调用,有时会发生这些调用两次处理。结果是我的表中的一些条目加倍,这导致了进一步的问题。每次发生这种情况时都会抛出org.apache.cxf.interceptor.Fault异常,我不知道为什么。根据日志文件,这两个进程在1-2毫秒内发生,所以我认为这可能是线程问题,但我不完全理解堆栈跟踪。任何帮助表示赞赏。

此Web服务在Jetty 7.2.2中的Java7上运行。

以下完整的stracktrace: (对不起那里的德语部分。" starte speichern"表示"开始保存"" erfolgreich gespeichert"表示"成功保存")

08:09:49.166 [jetty-36] INFO  d.v.g.w.v.s.i.VorgangsdatenServiceImpl - Starte Speichern des Vorgangs mit der VorgangsID E2016-06-24-08.09.48.993000/1 
08:09:49.167 [jetty-31] INFO  d.v.g.w.v.s.i.VorgangsdatenServiceImpl - Starte Speichern des Vorgangs mit der VorgangsID E2016-06-24-08.09.48.993000/1 
08:09:49.176 [jetty-36] INFO  d.v.g.w.v.s.i.VorgangsdatenServiceImpl - SET_VORGANG INSERT INTO DMS.VORGANGSPOOL_PUFFER : Vorgang 'E2016-06-24-08.09.48.993000 / 1' erfolgreich gespeichert. 
08:09:49.177 [jetty-36] WARN  o.a.cxf.phase.PhaseInterceptorChain - Interceptor for {http://xxx}Service#{http://xxx}setVorgang has thrown exception, unwinding now 
org.apache.cxf.interceptor.Fault: null
    at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:108) ~[cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.wsdl.interceptors.BareOutInterceptor.handleMessage(BareOutInterceptor.java:68) ~[cxf-rt-wsdl-3.1.3.jar:3.1.3]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [servlet-api-2.5.jar:na]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1351) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:77) [jetty-servlets-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:170) [jetty-servlets-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:473) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:516) [jetty-security-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:151) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:121) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.Server.handle(Server.java:352) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1068) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805) [jetty-http-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218) [jetty-http-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:508) [jetty-io-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34) [jetty-io-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40) [jetty-io-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451) [jetty-util-7.2.2.v20101205.jar:7.2.2.v20101205]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_21]
Caused by: c: null
    at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:255) ~[woodstox-core-asl-4.4.1.jar:4.4.1]
    at org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor.writeParts(AbstractOutDatabindingInterceptor.java:106) ~[cxf-core-3.1.3.jar:3.1.3]
    ... 44 common frames omitted
Caused by: org.eclipse.jetty.io.EofException: null
    at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:149) ~[na:na]
    at org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:96) ~[na:na]
    at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:51) ~[cxf-core-3.1.3.jar:3.1.3]
    at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:100) ~[woodstox-core-asl-4.4.1.jar:4.4.1]
    at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:241) ~[woodstox-core-asl-4.4.1.jar:4.4.1]
    at com.ctc.wstx.sw.BaseStreamWriter.flush(BaseStreamWriter.java:253) ~[woodstox-core-asl-4.4.1.jar:4.4.1]
    ... 45 common frames omitted
08:09:49.178 [jetty-31] INFO  d.v.g.w.v.s.i.VorgangsdatenServiceImpl - SET_VORGANG INSERT INTO DMS.VORGANGSPOOL_PUFFER : Vorgang 'E2016-06-24-08.09.48.993000 / 1' erfolgreich gespeichert. 
08:09:49.180 [jetty-36] WARN  o.a.cxf.phase.PhaseInterceptorChain - Interceptor for {http://xxx}Service#{xxx}setVorgang has thrown exception, unwinding now 
org.apache.cxf.interceptor.Fault: Could not send Message.
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64) ~[cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:112) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.phase.PhaseInterceptorChain.wrapExceptionAsFault(PhaseInterceptorChain.java:366) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:324) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121) [cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [servlet-api-2.5.jar:na]
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268) [cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:534) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1351) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlets.UserAgentFilter.doFilter(UserAgentFilter.java:77) [jetty-servlets-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlets.GzipFilter.doFilter(GzipFilter.java:170) [jetty-servlets-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1322) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:473) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:516) [jetty-security-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:929) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:403) [jetty-servlet-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:184) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:864) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:247) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:151) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.StatisticsHandler.handle(StatisticsHandler.java:121) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:114) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.Server.handle(Server.java:352) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:596) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1068) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:805) [jetty-http-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:218) [jetty-http-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:426) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:508) [jetty-io-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.access$000(SelectChannelEndPoint.java:34) [jetty-io-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:40) [jetty-io-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:451) [jetty-util-7.2.2.v20101205.jar:7.2.2.v20101205]
    at java.lang.Thread.run(Unknown Source) [na:1.7.0_21]
Caused by: org.eclipse.jetty.io.EofException: null
    at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:911) ~[na:na]
    at org.eclipse.jetty.http.HttpGenerator.complete(HttpGenerator.java:809) ~[na:na]
    at org.eclipse.jetty.server.HttpConnection.commitResponse(HttpConnection.java:721) [jetty-server-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.server.HttpConnection$Output.close(HttpConnection.java:1125) ~[na:na]
    at org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStream.close(AbstractHTTPDestination.java:799) ~[cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) ~[cxf-core-3.1.3.jar:3.1.3]
    at org.apache.cxf.transport.http.AbstractHTTPDestination$BackChannelConduit.close(AbstractHTTPDestination.java:729) ~[cxf-rt-transports-http-3.1.3.jar:3.1.3]
    at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) ~[cxf-core-3.1.3.jar:3.1.3]
    ... 46 common frames omitted
Caused by: java.nio.channels.ClosedChannelException: null
    at sun.nio.ch.SocketChannelImpl.ensureWriteOpen(Unknown Source) ~[na:1.7.0_21]
    at sun.nio.ch.SocketChannelImpl.write(Unknown Source) ~[na:1.7.0_21]
    at org.eclipse.jetty.io.nio.ChannelEndPoint.flush(ChannelEndPoint.java:187) ~[na:na]
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.flush(SelectChannelEndPoint.java:275) [jetty-io-7.2.2.v20101205.jar:7.2.2.v20101205]
    at org.eclipse.jetty.http.HttpGenerator.flushBuffer(HttpGenerator.java:849) ~[na:na]
    ... 53 common frames omitted

0 个答案:

没有答案