Re: Marshal POJO back to XML

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Marshal POJO back to XML

skin27
I think the best thing to do, is to create a Stackoverflow issue first. The
issue should contain all your code (Camel DSL, pojo etc). Then you can post
the link to the Stackoverflow issue here. I then would be easier to answer
for the community.

regards,
Raymond

Op ma 4 mei 2020 om 12:40 schreef Paul Broughton <[hidden email]>:

> Hi, I am reasonably certain I am missing something obvious here so
> hopefully somebody will be able to spot  that straight away.‚Äč
>
> I have a JSON packet coming into a route which is being unmarshaled and
> pushed into a dozer mapping which produces me a POJO (test.MYPOJO) of a
> type that was originally generated using JAXB
> When I try to marshal that object I get an error "no body available of
> type: javax.xml.bind.JAXBElement". This is of course true, the $body is of
> the type  test.MYPOJO. I know that test.MYPOJO has the necessary anotations
> so I am assume I need to get to the JAXBElement within the class but for
> the life of me I cant work out how.
>
> I am using camel 2.23.0
> I have a JAXBDataFormat defined that has setIgnoreJAXBElement set to false
> as per the guide. I can prove that I am able to unmarshal an xml example as
> well using the dataformat.
>
> any advice would me much appreciated
>
> regards
> Paul