title: Type Converter in Apache Camel is not working
body: <p>I have a Camel Route which is calling another Camel endpoint using "direct-vm". At the end of the second Camel Route I am returning a custom object "SelectResponse" by marshaling and serializing it. And in the first Camel route I am unmarshaling and serializing it. After unmarshaling I am trying yo convert the custom object to a JAXB object.</p>
  
  <p>First Camel Route</p>
  
  <pre><code>from(endpoint)
              .routeId(ROUTE_ID)
              .inOut("validator:classpath:xsd/abcd.xsd")
              .convertBodyTo(SelectRequest.class)
              .marshal().serialization()
              .inOut(selectDomainServiceURI) 
              //.unmarshal().serialization()
              .convertBodyTo(SelectRS.class)
              .convertBodyTo(String.class)
              .end()
  </code></pre>
  
  <p>Second Camel Route</p>
  
  <pre><code>from("direct-vm:SelectDomainRoute")
              .routeId(this.getClass().getName())
              .unmarshal().serialization()
              .bean(selectRequestProcessor)
              //.marshal().serialization()
              .end()
  </code></pre>
  
  <p>In this camel route I am having 2 issues, which are as follows:
  First, during unmarshaling camel is throwing ClassNotFound Exception. To overcome it I stopped marshaling in the second route and stopped unmarshaling in the first one. After doing this the ClassNotFound Exception is removed, but Camel is not able to find the correct converter method to convert the custom returned object to JAXB object. 
  My converter has the below method - </p>
  
  <pre><code>@Converter public static SelectRS toSelectRS(SelectResponse selectResponse, Exchange exchange) throws Exception {
      return domainToJaxbObjectConverter.convert(selectResponse);
  }
  </code></pre>
  
  <p>But this method is not invoked and it is throwing the below exception - </p>
  
  <pre><code>org.apache.camel.InvalidPayloadException: 
    No body available of type: com...SelectRS but has value: com...SelectResponse@7c06d219 of type: com...SelectResponse on: Message: com...SelectResponse@7c06d219. 
    Caused by: No type converter available to convert from type: com...SelectResponse to the required type: com...SelectRS with value com...SelectResponse@7c06d219. Exchange[Message: com...SelectResponse@7c06d219]. 
    Caused by: [org.apache.camel.NoTypeConversionAvailableException - No type converter available to convert from type: com...SelectResponse to the required type: com...SelectRS with value com...SelectResponse@7c06d219] 
  </code></pre>
  
  <p>Any help in the Camel unmarshaling error and Camel converter error are appreciated. </p>