endDoTry() is only needed in some cases if you use doTry .. doCatch.
And you must have a doTry, which you do NOT have.



On Mon, Nov 11, 2013 at 6:17 PM, kamranzafar <[email protected]> wrote:
> Hi I am having the same issue in camel version 2.10.2. The route below throws
> exception
>
> from("jpa:org.example.SystemProperty?consumeDelete=true&consumer.namedQuery=ControlProductLoadTrigger")
>         .routeId(getClass().getSimpleName()).doTry().process(new Processor()
> {
>     @Override
>     public void process(Exchange exchange) throws Exception {
>         List<Product> products = fetchProducts();
>         exchange.getIn().setBody(products);
>     }
> }).split(body()).to("jpa:org.example.Product").endDoTry().doCatch(Throwable.class)
>         .transform().simple("${exception.message}").log(LoggingLevel.ERROR,
> "${body}").end();
>
> This gives me:
>
> java.lang.ClassCastException: org.apache.camel.model.RouteDefinition cannot
> be cast to org.apache.camel.model.TryDefinition
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/endDoTry-problem-tp5543541p5743050.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

Reply via email to