You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Samruben <ra...@gmail.com> on 2012/02/21 13:26:00 UTC

passing jaxb object to xml

Hi I have tried an example to marshal and unmarshal in the router using
jaxb.I need to pass the jaxb dataformat object as reference to the xml flow
and do the marshalling and unmarshalling.


my router without marshal:

<?xml version="1.0" encoding="UTF-8"?>
<routes xmlns="http://camel.apache.org/schema/spring">

  <route>
            <from uri="text-jms:queue:orderjax.queue"/>
            <marshal ref="jaxb"/>
            <to uri="text2-jms:queue:orderrecevied.queue"/>
        </route>

        
  </camelContext> 

but it shows me error that

Exception in thread "main" org.apache.camel.CamelExecutionException:
Exception occurred during execution on the exchange: Exchange[Message: <?xml
version="1.0" encoding="UTF-8" standalone="yes"?>
<purchaseOrder amount="1.0" price="4995.0" name="Camel in Action"/>
]
	at
org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1212)

 

--
View this message in context: http://camel.465427.n5.nabble.com/passing-jaxb-object-to-xml-tp5502038p5502038.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: passing jaxb object to xml

Posted by Christian Müller <ch...@gmail.com>.
Did you had a look at [1]? Here you can find a example how to
marshall/unmarshall in Camel.

[1] http://camel.apache.org/jaxb.html

Best,
Christian

On Tue, Feb 21, 2012 at 1:26 PM, Samruben <ra...@gmail.com> wrote:

> Hi I have tried an example to marshal and unmarshal in the router using
> jaxb.I need to pass the jaxb dataformat object as reference to the xml flow
> and do the marshalling and unmarshalling.
>
>
> my router without marshal:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <routes xmlns="http://camel.apache.org/schema/spring">
>
>  <route>
>            <from uri="text-jms:queue:orderjax.queue"/>
>            <marshal ref="jaxb"/>
>            <to uri="text2-jms:queue:orderrecevied.queue"/>
>        </route>
>
>
>  </camelContext>
>
> but it shows me error that
>
> Exception in thread "main" org.apache.camel.CamelExecutionException:
> Exception occurred during execution on the exchange: Exchange[Message:
> <?xml
> version="1.0" encoding="UTF-8" standalone="yes"?>
> <purchaseOrder amount="1.0" price="4995.0" name="Camel in Action"/>
> ]
>        at
>
> org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1212)
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/passing-jaxb-object-to-xml-tp5502038p5502038.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>