Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-7044

LoggingInInterceptor sometimes crashes if truncates response with Unicode simbols

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.5, 3.1.1, 3.1.3, 3.1.6, 3.0.9, 3.1.7
    • 3.1.8, 3.0.11, 3.2.0
    • Core
    • None
    • Unknown

    Description

      When LoggingInInterceptor logs a big response it truncates it to some default (or configured) limit in bytes. It can happens that some Unicode symbol will be divided on such truncating (if it is placed right on the border of the limit). In this case the logger throws the exception as it considers this as "Unexpected EOF in the middle of a multi-byte char" or "Unexpected EOF in CDATA section"

      Affects to all versions as it comes from third party library "woodstox-core-asl-4.4.1.jar"

      PS There was a default limit set (48 * 1024 bytes) when faced with this problem (it can be seen from exception's message below)

      Here is example of stack trace:

      org.apache.cxf.interceptor.Fault: [com.ctc.wstx.exc.WstxLazyException] Unexpected EOF in the middle of a multi-byte char: got 1, needed 2, at char #49138, byte #49152)
      at org.apache.cxf.interceptor.LoggingInInterceptor.logInputStream(LoggingInInterceptor.java:220) ~[cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.interceptor.LoggingInInterceptor.logging(LoggingInInterceptor.java:154) ~[cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.interceptor.LoggingInInterceptor.handleMessage(LoggingInInterceptor.java:80) ~[cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:802) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1642) [cxf-rt-transports-http-3.1.0.jar:3.1.0]
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1533) [cxf-rt-transports-http-3.1.0.jar:3.1.0]
      at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1336) [cxf-rt-transports-http-3.1.0.jar:3.1.0]
      at org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutputStream.java:56) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:215) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:652) [cxf-rt-transports-http-3.1.0.jar:3.1.0]
      at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:516) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:425) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:326) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:279) [cxf-core-3.1.0.jar:3.1.0]
      at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96) [cxf-rt-frontend-simple-3.1.0.jar:3.1.0]
      at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:139) [cxf-rt-frontend-jaxws-3.1.0.jar:3.1.0]
      at com.sun.proxy.$Proxy262.transactionList(Unknown Source) [na:na]

      Attachments

        Issue Links

          Activity

            People

              sergey_beryozkin Sergey Beryozkin
              Illia Yehorov Illia Yehorov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: