7 Replies Latest reply on Feb 24, 2012 2:35 AM by gauthamr

    parse stream exception

    gauthamr

      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,

        • 1. Re: parse stream exception
          ffang

          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

          • 2. Re: parse stream exception
            gauthamr

            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

            • 3. Re: parse stream exception
              ffang

              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 to get more details.

               

              http://camel.apache.org/stream-caching.html

               

              Freeman

              • 4. Re: parse stream exception
                gauthamr

                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

                • 5. Re: parse stream exception
                  njiang

                  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

                  • 6. Re: parse stream exception
                    gauthamr

                    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

                    • 7. Re: parse stream exception
                      gauthamr

                      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