You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2009/12/21 21:45:18 UTC

[jira] Commented: (CXF-2512) Faults while writing cause problems

    [ https://issues.apache.org/jira/browse/CXF-2512?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793352#action_12793352 ] 

Daniel Kulp commented on CXF-2512:
----------------------------------


I'm tempted to resolve this as "not much we can do here".    It's pretty much working as designed.   On the normal out chain, we really cannot determine what the cause of the fault is to take any time of appropriate action.   You could look for an IOException, but that's not really correct either cause if an interceptor calls off to something else (like to validate a SAML token) and that fails due to an IOException, it would pretty much look the same to the PhaseInterceptorChain.    

Basically, if the PIC gets a fault, it need to at least attempt to write it out.   If that fails, we really do need to log it so the admin know a fault wasn't able to be sent back. 

The ONLY thing I can think of that MIGHT work would be for the HttpDestination to wrapper the raw OutputStream with a wrapper that would catch/record/rethrow any IOException on the actual writes to the underlying stream.   If there is a failure, during the fault write, just swallow  any faults that would be thrown.     Not sure how well that would work. 

> Faults while writing cause problems
> -----------------------------------
>
>                 Key: CXF-2512
>                 URL: https://issues.apache.org/jira/browse/CXF-2512
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.3
>            Reporter: Benson Margulies
>            Priority: Minor
>
> This backtrace shows that someone is trying to create a fault after the process of writing the response has started. This cannot be good. I'll attach more as I debug more.
> Nov 1, 2009 6:37:13 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
> INFO: Creating Service {http://fortest.javascript.cxf.apache.org/}AegisService from class org.apache.cxf.javascript.fortest.AegisService
> Nov 1, 2009 6:37:14 AM org.apache.cxf.endpoint.ServerImpl initDestination
> INFO: Setting the server's publish address to be http://localhost:8808/aegis
> Nov 1, 2009 6:37:14 AM org.mortbay.log.Slf4jLog info
> INFO: Logging to org.slf4j.impl.JDK14LoggerAdapter(org.mortbay.log) via org.mortbay.log.Slf4jLog
> Nov 1, 2009 6:37:14 AM org.mortbay.log.Slf4jLog info
> INFO: jetty-6.1.21
> Nov 1, 2009 6:37:14 AM org.mortbay.log.Slf4jLog info
> INFO: Started SelectChannelConnector@localhost:8808
> Nov 1, 2009 6:37:21 AM org.apache.cxf.javascript.AegisTest acceptAny
> INFO: About to call acceptAny with Raw XMLhttp://localhost:8808/aegis
> Nov 1, 2009 6:37:28 AM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> WARNING: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter.
> 	at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:282)
> 	at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:1)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:76)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
> 	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
> 	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
> 	at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> 	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:326)
> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
> 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
> 	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> Caused by: com.ctc.wstx.exc.WstxIOException: null
> 	at com.ctc.wstx.sw.BaseStreamWriter._finishDocument(BaseStreamWriter.java:1431)
> 	at com.ctc.wstx.sw.BaseStreamWriter.writeEndDocument(BaseStreamWriter.java:553)
> 	at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:277)
> 	... 19 more
> Caused by: org.mortbay.jetty.EofException
> 	at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:631)
> 	at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:579)
> 	at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:46)
> 	at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:100)
> 	at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:225)
> 	at com.ctc.wstx.sw.BufferingXmlWriter.close(BufferingXmlWriter.java:198)
> 	at com.ctc.wstx.sw.BaseStreamWriter._finishDocument(BaseStreamWriter.java:1429)
> 	... 21 more
> Nov 1, 2009 6:37:28 AM org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor$Soap11FaultOutInterceptorInternal handleMessage
> WARNING: Error writing to XMLStreamWriter.
> javax.xml.stream.XMLStreamException: Trying to output second root, <soap:Fault>
> 	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1547)
> 	at com.ctc.wstx.sw.BaseStreamWriter.throwOutputError(BaseStreamWriter.java:1554)
> 	at com.ctc.wstx.sw.BaseStreamWriter.reportNwfStructure(BaseStreamWriter.java:1582)
> 	at com.ctc.wstx.sw.BaseNsStreamWriter.checkStartElement(BaseNsStreamWriter.java:465)
> 	at com.ctc.wstx.sw.SimpleNsStreamWriter.writeStartOrEmpty(SimpleNsStreamWriter.java:252)
> 	at com.ctc.wstx.sw.BaseNsStreamWriter.writeStartElement(BaseNsStreamWriter.java:313)
> 	at org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor$Soap11FaultOutInterceptorInternal.handleMessage(Soap11FaultOutInterceptor.java:78)
> 	at org.apache.cxf.binding.soap.interceptor.Soap11FaultOutInterceptor$Soap11FaultOutInterceptorInternal.handleMessage(Soap11FaultOutInterceptor.java:1)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:96)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:284)
> 	at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:76)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
> 	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
> 	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
> 	at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> 	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:326)
> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
> 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
> 	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> Nov 1, 2009 6:37:28 AM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> WARNING: Interceptor has thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: Error writing to XMLStreamWriter.
> 	at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:282)
> 	at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:1)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:76)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
> 	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
> 	at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
> 	at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
> 	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
> 	at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
> 	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
> 	at org.mortbay.jetty.Server.handle(Server.java:326)
> 	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
> 	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
> 	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
> 	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
> 	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
> 	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
> 	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
> Caused by: com.ctc.wstx.exc.WstxIOException: null
> 	at com.ctc.wstx.sw.BaseStreamWriter._finishDocument(BaseStreamWriter.java:1431)
> 	at com.ctc.wstx.sw.BaseStreamWriter.writeEndDocument(BaseStreamWriter.java:553)
> 	at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:277)
> 	... 19 more
> Caused by: org.mortbay.jetty.EofException
> 	at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:631)
> 	at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGenerator.java:579)
> 	at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:46)
> 	at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:100)
> 	at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:225)
> 	at com.ctc.wstx.sw.BufferingXmlWriter.close(BufferingXmlWriter.java:198)
> 	at com.ctc.wstx.sw.BaseStreamWriter._finishDocument(BaseStreamWriter.java:1429)
> 	... 21 more
> Nov 1, 2009 6:37:28 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
> INFO: Creating Service {http://fortest.javascript.cxf.apache.org/}AegisService from class org.apache.cxf.javascript.fortest.AegisService
> Nov 1, 2009 6:37:28 AM org.apache.cxf.endpoint.ServerImpl initDestination
> INFO: Setting the server's publish address to be http://localhost:8808/aegis
> Nov 1, 2009 6:37:28 AM org.mortbay.log.Slf4jLog info
> INFO: jetty-6.1.21
> Nov 1, 2009 6:37:28 AM org.mortbay.log.Slf4jLog info
> INFO: Started SelectChannelConnector@localhost:8808
> Nov 1, 2009 6:37:29 AM org.apache.cxf.javascript.AegisTest acceptAnyTyped
> INFO: About to call acceptAny with Raw XML and xsi:typehttp://localhost:8808/aegis
> Nov 1, 2009 6:37:29 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromClass
> INFO: Creating Service {http://fortest.javascript.cxf.apache.org/}AegisService from class org.apache.cxf.javascript.fortest.AegisService
> Nov 1, 2009 6:37:29 AM org.apache.cxf.endpoint.ServerImpl initDestination
> INFO: Setting the server's publish address to be http://localhost:8808/aegis
> Nov 1, 2009 6:37:29 AM org.mortbay.log.Slf4jLog info
> INFO: jetty-6.1.21
> Nov 1, 2009 6:37:29 AM org.mortbay.log.Slf4jLog info
> INFO: Started SelectChannelConnector@localhost:8808

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.