You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Babak Vahdat (Resolved) (JIRA)" <ji...@apache.org> on 2012/01/27 21:14:10 UTC

[jira] [Resolved] (CAMEL-4942) exchange.getIn().getBody(.class) throws an exception for Jaxb model objects

     [ https://issues.apache.org/jira/browse/CAMEL-4942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Babak Vahdat resolved CAMEL-4942.
---------------------------------

    Resolution: Fixed

Back-ported to both 2.8.x & 2.9.x branches as well.
                
> exchange.getIn().getBody(<SomeClass>.class) throws an exception for Jaxb model objects
> --------------------------------------------------------------------------------------
>
>                 Key: CAMEL-4942
>                 URL: https://issues.apache.org/jira/browse/CAMEL-4942
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core, camel-jaxb
>    Affects Versions: 2.8.3
>            Reporter: Christian Müller
>            Assignee: Babak Vahdat
>             Fix For: 2.8.5, 2.9.1, 2.10.0
>
>         Attachments: test.zip
>
>
> {code}
> exchange.getIn().getBody(Foo.class);
> {code}
> should return a Foo instance or null, if no suitable type converter is available. The java doc says: "return the body of the message as the specified type, or <tt>null</tt> if not possible to convert"
> If Foo is an Jaxb object model, this method call:
> - throws an org.xml.sax.SAXParseException if the body content is a string
> - throws a javax.xml.bind.UnmarshalException if the body content is another Jaxb model object
> Please have a look on the attached sample eclipse project.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira