Hi You get this error because there is no type converter in Camel to convert from that JSONtype your return in that bean to a String.
You need to add such a converter yourself, and convert to string from a bean or something. http://camel.apache.org/type-converter.html On Thu, Apr 24, 2014 at 2:59 PM, Preethi <[email protected]> wrote: > Here's how the rote looks like > > from("direct:runlegacyrules") > .routeId("executeLegacyRules") > .setProperty(SupplyItemRoutesConstants.ORIGINAL_MESSAGE, > body()) > .setHeader(Exchange.HTTP_METHOD, constant(HttpMethods.POST)) > .setHeader(Exchange.ACCEPT_CONTENT_TYPE, > constant(SupplyItemRoutesConstants.JSON_CONTENT_TYPE)) > .bean(jsonSupplyItemConverter, > "convertToSupplyItemLegacyJson") > .convertBodyTo(String.class) > .choice() > //routing to this endpoint will check if V1 Legacy > validation toggle is > turned "on" or "off" > .when(predicate.new > DivisionPredicate()).to(SupplyItemRoutesConstants.TOGGLE_V1_LEGACY_VALIDATION_ENDPOINT) > //routing to this endpoint will check if V2 Legacy > validation toggle is > turned "on" or "off" > .when(not(predicate.new > DivisionPredicate())).to(SupplyItemRoutesConstants.TOGGLE_V2_LEGACY_VALIDATION_ENDPOINT) > .end(); > > The route above takes the message converts to JSON using the converter > jsonSupplyItemConverter and then converts to to String.class to be passed on > to the DivisionPredicate. > The intermittent exception occurs while converting the json to String.class. > This route is deployed on tomcat. > > Thanks, > Preethi > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Failing-to-load-converters-tp5750509p5750532.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
