You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by John <Jo...@ateb.com> on 2010/12/14 16:12:54 UTC

onException not catching exception

Hi,

I have the following route that worked in 2.2 but doesn't appear to work in
2.5:

        from("direct:POSTINGAPP.REQ.LISTSPLITTER")      
            .routeId("splitterRouter")
           
.onException(InvalidXPathExpression.class).handled(true).log("Invalid xpath
posting request").end()
            .split(xpath("/getPostingListResponse/postingRequest"))
                .to("activemq:some_queue");

I'm running a unit test against that route where I send a null message. In
2.2 the InvalidXpathException is handled by the onException as I would
expect. When I run the same test with 2.5, the onException doesn't fire.

Instead, I get a stack trace with a CamelExecutionException that is caused
by InvalidXpathExpression

Any suggestions on what is different in 2.5 with regards to handling that
exception?

Thanks,

-john
-- 
View this message in context: http://camel.465427.n5.nabble.com/onException-not-catching-exception-tp3304725p3304725.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: onException not catching exception

Posted by John <Jo...@ateb.com>.
2.6 fixes it. Thanks Claus!
-- 
View this message in context: http://camel.465427.n5.nabble.com/onException-not-catching-exception-tp3304725p3304872.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: onException not catching exception

Posted by davsclaus <ci...@yahoo.dk>.
Try with 2.6-SNAPSHOT, as I think its fixed there.
-- 
View this message in context: http://camel.465427.n5.nabble.com/onException-not-catching-exception-tp3304725p3304734.html
Sent from the Camel - Users mailing list archive at Nabble.com.