title: marshal JAXB generated classes without XmlRootElement with Apache camel
body: <p>In order to marshal jaxb classes with Apache Camel the jaxb class needs to include a XmlRootElement annotation.</p>
  
  <p>When generating jaxb classes from XSD the XmlRootElement annotation might not be generated.</p>
  
  <p>This will lead to an Exception during marshalling 
   "No type converter available to convert from type: "</p>
  
  <p>As soon as I add the @XmlRootElement manually, everything works fine, but since these Jaxb classes are generated, adding the anntotation manually is no option.</p>
  
  <p>According to the Camel documentation in such a case, the JaxbDataFormat can be set to 'fragement(true)</p>
  
  <pre><code>JaxbDataFormat jaxbMarshal = new JaxbDataFormat();
  jaxbMarshal.setContextPath(ObjectFactory.class.getPackage().getName());
  jaxbMarshal.setFragment(true);
  </code></pre>
  
  <p>Unfortunately I still get the same exception.</p>
  
  <p>Is there a way to configure JaxbDataFormat different, i.e. to define the JAXBElement which is the root element, like I would do in Java  </p>
  
  <pre><code>marshaller.marshal( new JAXBElement( new QName("uri","local"),
     MessageType.class, messageType ));
  </code></pre>
  
  <p>or is there another strategy available to get the XML marshalled?</p>
  
  <p>EDIT
  the used route :</p>
  
  <pre><code> from("file://inbox").unmarshal(jaxbDataFormat)
  .marshal(jaxbDataFormat).to("file://outbox");
  </code></pre>
  
  <p>the stacktrace:</p>
  
  <blockquote>
    <p>java.io.IOException: org.apache.camel.NoTypeConversionAvailableException: No type converter
    available to convert from type: com.xyz.AddressType to the required
    type: java.io.InputStream with value com.xyz.AddressType@32317e9d     at
    org.apache.camel.converter.jaxb.JaxbDataFormat.marshal(JaxbDataFormat.java:148)
    ~[camel-jaxb-2.16.0.jar:2.16.0]   at
    org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:83)
    ~[camel-core-2.16.0.jar:2.16.0]   at</p>
    
    <p>...</p>
    
    <p>[na:1.8.0_25]     at java.lang.Thread.run(Thread.java:745) [na:1.8.0_25]
    Caused by: org.apache.camel.NoTypeConversionAvailableException: No
    type converter available to convert from type: com.xyz.AddressType to
    the required type: java.io.InputStream with value
    com.xyz.AddressType@32317e9d  at
    org.apache.camel.impl.converter.BaseTypeConverterRegistry.mandatoryConvertTo(BaseTypeConverterRegistry.java:185)
    ~[camel-core-2.16.0.jar:2.16.0]   at</p>
    
    <p>...</p>
  </blockquote>