You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Neo <ra...@gmail.com> on 2012/04/19 05:00:45 UTC

Camel 2.9 - fails to converts a XML JMS Body to Java Bean

Hi,


The following is my Route in general tems:
*
JMS Topic -> Async Camel JMS Subscriber ->SEDA -> CONVERTBODYTO -> SEDA
->ENRICH ->SEDA->RESTFUL SERVICE CALLOUT*

       In the current application that I am working on , I use the
convertbodyto tag to convert the incoming JMS Body of XML type to a Java
Object. 

The convertbodyto tag works and it converts the JMS Body to the given type.

In one case , I have sent a wrong XML in the JMS Body and the convertbodyto
has errored out trying to convert the message to Java Bean.

It is after this that the problem started.

The next message that I sent was the correct XML message in the JMS body ,
but then Camel threw the same JAXB InvalidPayload exception for this correct
XML too.

The logic just broke for the rest of the messages as it threw the same
exception for every message read from the JMS Topic.

Did anyone see such kind of behaviour ? Or am I supposed to clear some
message header that I am not clearing?

Can anyone please help ?

Cheers,
Neo

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-9-convertbodyto-fails-to-converts-a-XML-JMS-Body-to-Java-Bean-tp5650739p5650739.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel 2.9 - fails to converts a XML JMS Body to Java Bean

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Apr 19, 2012 at 4:03 PM, Neo <ra...@gmail.com> wrote:
> Claus for the rescue !!
>
> Thank you very much for your response Claus !!
>
> I have temporarily used the below to resolve the original issue :
>
> <from uri="">
> <unmarshal>
>            <jaxb prettyPrint="false" contextPath="mycontext"
>                partClass="mycontext.MyClass" />
> </unmarshal>
> <log>
> <to uri="">
>
>
>
> (I could have used the jaxb dataformat itself, but wanted to try this
> partClass option and see if this would even work )
> When I use the above code snippet instead of the convertbodyto , and
> re-executed the test case - Everything went fine.
>
> Can you please validate if this would work atleast until the 2.9.3 or 2.10
> are released ?

Yes using the data format works fine. Its *only* the type converter
that is the issue.

> Is there a possibility to let us know when the release is scheduled for ?
>
> Cheers,
> Neo
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-2-9-convertbodyto-fails-to-converts-a-XML-JMS-Body-to-Java-Bean-tp5650739p5651831.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Camel 2.9 - fails to converts a XML JMS Body to Java Bean

Posted by Neo <ra...@gmail.com>.
Claus for the rescue !!

Thank you very much for your response Claus !!

I have temporarily used the below to resolve the original issue :

<from uri="">
<unmarshal>
            <jaxb prettyPrint="false" contextPath="mycontext"
                partClass="mycontext.MyClass" />
</unmarshal>
<log>
<to uri="">



(I could have used the jaxb dataformat itself, but wanted to try this
partClass option and see if this would even work )
When I use the above code snippet instead of the convertbodyto , and
re-executed the test case - Everything went fine. 

Can you please validate if this would work atleast until the 2.9.3 or 2.10
are released ?
Is there a possibility to let us know when the release is scheduled for ?

Cheers,
Neo

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-2-9-convertbodyto-fails-to-converts-a-XML-JMS-Body-to-Java-Bean-tp5650739p5651831.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel 2.9 - fails to converts a XML JMS Body to Java Bean

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Apr 19, 2012 at 5:00 AM, Neo <ra...@gmail.com> wrote:
> Hi,
>
>
> The following is my Route in general tems:
> *
> JMS Topic -> Async Camel JMS Subscriber ->SEDA -> CONVERTBODYTO -> SEDA
> ->ENRICH ->SEDA->RESTFUL SERVICE CALLOUT*
>
>       In the current application that I am working on , I use the
> convertbodyto tag to convert the incoming JMS Body of XML type to a Java
> Object.
>
> The convertbodyto tag works and it converts the JMS Body to the given type.
>
> In one case , I have sent a wrong XML in the JMS Body and the convertbodyto
> has errored out trying to convert the message to Java Bean.
>
> It is after this that the problem started.
>
> The next message that I sent was the correct XML message in the JMS body ,
> but then Camel threw the same JAXB InvalidPayload exception for this correct
> XML too.
>
> The logic just broke for the rest of the messages as it threw the same
> exception for every message read from the JMS Topic.
>
> Did anyone see such kind of behaviour ? Or am I supposed to clear some
> message header that I am not clearing?
>
> Can anyone please help ?
>

That sounds like the bug that is fixed in the upcoming 2.9.3 and 2.10 releases.

Discussed here
http://camel.465427.n5.nabble.com/HEADS-UP-TypeConverter-improved-in-Camel-2-10-td5645689.html

> Cheers,
> Neo
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-2-9-convertbodyto-fails-to-converts-a-XML-JMS-Body-to-Java-Bean-tp5650739p5650739.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/