Forum Home » Fuse Distributions » Fuse Services Framework

Thread: parse stream exception

 

Permlink Replies: 7 - Last Post: Feb 24, 2012 9:38 AM Last Post By: gauthamr7657
gauthamr7657

Posts: 22
Registered: 02/09/12
parse stream exception
Posted: Feb 23, 2012 12:56 PM
  Click to reply to this thread Reply
Attachment parseError.txt (6.5 KB)
Hi,

I am trying to route from one cxf endpoint which takes the request to an other cxf endpoint where an external service is running which understands the same message format as per the request, but facing "coudn't parse stream" error.

I have attached the same. Kindly someone let me know how to debug this

Regards,
ffang

Posts: 1,320
Registered: 12/24/07
Re: parse stream exception
Posted: Feb 24, 2012 12:59 AM   in response to: gauthamr7657 in response to: gauthamr7657
  Click to reply to this thread Reply
Hi,

Could you elaborate your scenario?
From the stacktrace seems you're using camel-cxf endpoint, could you post your router here so that you can get more concrete help quickly?

The "coudn't parse stream" could caused by the stream already get consumed, you can try to add streamCache="true" attribute to your camelContext/router to see if it helps.

Freeman
gauthamr7657

Posts: 22
Registered: 02/09/12
Re: parse stream exception
Posted: Feb 24, 2012 5:47 AM   in response to: ffang in response to: ffang
  Click to reply to this thread Reply
Attachment route.txt (875 bytes)
Hi,

Basically what I am trying here is, taking a request at my service cxf endpoint , applying a transformation to that request body and routing the same to another cxf endpoint which understands the translated request.
I have attached a sample camel route as a reference.

Kindly let me know if this approach is wrong

Regards,
gautham
ffang

Posts: 1,320
Registered: 12/24/07
Re: parse stream exception
Posted: Feb 24, 2012 5:55 AM   in response to: gauthamr7657 in response to: gauthamr7657
  Click to reply to this thread Reply
Hi,

Ok, the xslt consumed the stream before send to the next cxf endpoint, so you need add
streamCache="true" to your route. Take a look at [1] to get more details.

[1]http://camel.apache.org/stream-caching.html

Freeman
gauthamr7657

Posts: 22
Registered: 02/09/12
Re: parse stream exception
Posted: Feb 24, 2012 6:12 AM   in response to: ffang in response to: ffang
  Click to reply to this thread Reply
Hi,

Sorry to say this but enabling streamCache didn't fix it.
I also tried bypassing the xsl translation but still getting the same parse stream issue. Is it because of my payload data format or am I doing something really wrong.

Regards,
gautham
gauthamr7657

Posts: 22
Registered: 02/09/12
Re: parse stream exception
Posted: Feb 24, 2012 9:38 AM   in response to: gauthamr7657 in response to: gauthamr7657
  Click to reply to this thread Reply
hi,
I somehow got the issue resolved by changing my jetty jar to point to cxf-core version.
With this i got an other issue " The PayLoad elements cannot fit with the message
parts of the BindingOperation. Please check the BindingOperation and PayLoadMessage"

So I just changed my data format from payload to message, it started working fine.
Although i still don't know how to work with payload option.

Regards,
Gautham

njiang

Posts: 572
Registered: 09/17/07
Re: parse stream exception
Posted: Feb 24, 2012 6:27 AM   in response to: gauthamr7657 in response to: gauthamr7657
  Click to reply to this thread Reply
org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:1181)cxf-common-utilities-2.5.2.jar:2.5.2
at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:104)cxf-rt-core-2.4.1-fuse-00-53.jar:2.4.1-fuse-00-53

It looks like you are put two different version CXF jars together.
Can you double check it ?

Willem
gauthamr7657

Posts: 22
Registered: 02/09/12
Re: parse stream exception
Posted: Feb 24, 2012 7:35 AM   in response to: njiang in response to: njiang
  Click to reply to this thread Reply
Attachment error.txt (6.5 KB)
Hi,
I checked and made sure my cxf-api,rt,utilities are pointing to same version of jars but still facing same error. Attached for reference

Regards,
Gautham