CXF - SAM monitoring - mixed up message

Six Stars

CXF - SAM monitoring - mixed up message

Hi,
we are experiencing a problem when org.apache.cxf.feature.LoggingFeature is applied on cxfEndpoint and large response (30k+) is returned from backend. Response is invalid XML and fails. It seems like response message is being processed by SAM but in the meantime CXF is trying to ship the message further to another processor. If I turn validation off, I see broken message.
Environment:
Talend 5.6.2
Karaf 2.3.9 (supplied with Talend installation)
Apache CXF 2.7.15
Camel-core 2.13.4
/// namespaces from blueprint disappeared during submitting this thread
Here is simple proxy:
<blueprint xmlns=""> 
 
<property-placeholder xmlns="" persistent-id="Proxy"/>
<camelContext xmlns="">
    <route id="Proxy">
      <from uri="Proxy_0"/>
      <to uri="Proxy_1"/>
    </route>
</camelContext>
<cxfEndpoint id="Proxy_0" ...>
  <properties>
   <entry xmlns="" key="schema-validation-enabled" value="true"/>
      <entry xmlns="" key="dataFormat" value="PAYLOAD"/>
   <entry xmlns="" key="allowStreaming" value="false"/>
  </properties>
  <features>
   <reference xmlns="" id="eventFeature" interface="org.talend.esb.sam.agent.feature.EventFeature"/>
  </features>
  <inInterceptors/>
  <outInterceptors/>
<cxfEndpoint>
<cxfEndpoint id="Proxy_1" ...>
  <properties>
   <entry xmlns="" key="schema-validation-enabled" value="true"/>
      <entry xmlns="" key="dataFormat" value="PAYLOAD"/>
   <entry xmlns="" key="allowStreaming" value="false"/>
  </properties>
  <features>
   <bean xmlns="" class="org.apache.cxf.feature.LoggingFeature"/>
   <reference xmlns="" id="eventFeature" interface="org.talend.esb.sam.agent.feature.EventFeature"/>
  </features>
  <inInterceptors/>
  <outInterceptors/>
<cxfEndpoint>
</blueprint>
Stack Trace:
Interceptor for {}Proxy#{}SampleMethod has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader.
        at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:259)
        at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:65)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
        at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:831)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1626)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1133)
        at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'C' (code 67) in prolog; expected '<'
 at :
        at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:639)
        at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2050)
        at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1133)
        at com.ctc.wstx.sr.BasicStreamReader.nextTag(BasicStreamReader.java:1156)
        at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:161)
        ... 10 more
09:47:00,866 | INFO  | 787683058-298626 | ache.cxf.common.logging.LogUtils  452 | 121 - org.apache.cxf.cxf-api - 2.7.15 | Application {}Proxy#{}SampleMethod has thrown exception, unwinding now: com.ctc.wstx.exc.WstxUnexpectedCharException: Error reading XMLStreamReader.
09:47:00,867 | WARN  | ult-workqueue-11 | ache.cxf.common.logging.LogUtils  452 | 121 - org.apache.cxf.cxf-api - 2.7.15 | Interceptor for {}Proxy#{}SampleProxy has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not parse the XML stream caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </bSmiley FrustratedubItem>; expected </b:Item>.
 at : .
        at org.apache.cxf.databinding.source.XMLStreamDataReader.read(XMLStreamDataReader.java:292)
        at org.apache.cxf.databinding.source.XMLStreamDataReader.validate(XMLStreamDataReader.java:211)
        at org.apache.cxf.databinding.source.XMLStreamDataReader.read(XMLStreamDataReader.java:111)
        at org.apache.cxf.databinding.source.XMLStreamDataReader.read(XMLStreamDataReader.java:79)
        at org.apache.cxf.databinding.source.XMLStreamDataReader.read(XMLStreamDataReader.java:63)
        at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:192)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
        at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:831)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1626)
        at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1133)
        at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)
        at java.lang.Thread.run(Thread.java:745)
Caused by: com.ctc.wstx.exc.WstxParsingException: Unexpected close tag </bSmiley FrustratedubItem>; expected </b:Item>.
 at :
        at com.ctc.wstx.sr.StreamScanner.constructWfcException(StreamScanner.java:606)
Moderator

Re: CXF - SAM monitoring - mixed up message

Hi,
Does this issue reproduce on other build version(6.2, 6.3)?
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
Six Stars

Re: CXF - SAM monitoring - mixed up message

Hi Sabrina,
sorry for late response. Issue was resolved with Talend Support Team.