Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-4942

exchange.getIn().getBody(<SomeClass>.class) throws an exception for Jaxb model objects

    XMLWordPrintableJSON

Details

    • Unknown

    Description

      exchange.getIn().getBody(Foo.class);
      

      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.

      Attachments

        1. test.zip
          13 kB
          Christian Müller

        Activity

          People

            bvahdat Babak Vahdat
            muellerc Christian Müller
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: