Re: onException in camel

2013-07-01 Thread Tarun Kumar
Hi Chrisrtian, Thanks for the reply. Issue in my case was, handleException of ExceptionHandler class had IOException as method parameter. I removed this method parameter from handleException method and it worked. I was wondering if there is any way to pass parameters to handleException method bea

Re: onException in camel

2013-06-30 Thread Christian Müller
This slightly modified unit test is also running successful: public class DoCatchDirectRouteTest extends ContextTestSupport { public void testDoCatchDirectRoute() throws Exception { MockEndpoint mock = getMockEndpoint("mock:exception"); mock.expectedBodiesReceived("Hello World

Re: onException in camel

2013-06-30 Thread Christian Müller
See http://camel.apache.org/try-catch-finally.html Best, Christian - Software Integration Specialist Apache Camel committer: https://camel.apache.org/team V.P. Apache Camel: https://www.apache.org/foundation/ Apache Member: https://www.apache.org/foundation/members.html https://

Re: onException in camel

2013-06-30 Thread Christian Müller
It's simple to update the unit test [1], so it looks like the following and it runs successful: public class OnExceptionHandledTest extends ContextTestSupport { public void testHandled() throws Exception { MockEndpoint mock = getMockEndpoint("mock:handled"); mock.expectedBodie

Re: onException in camel

2013-06-30 Thread Tarun Kumar
Hi, any help will be highly appreciated. In my case, why is my bean exception not being propagated to camel route? On Fri, Jun 28, 2013 at 12:38 PM, Tarun Kumar wrote: > Yes, i have looked all unit tests. > > In my case, abc method throws IOException. > when i surround this bean class with .doTr

Re: onException in camel

2013-06-28 Thread Tarun Kumar
Yes, i have looked all unit tests. In my case, abc method throws IOException. when i surround this bean class with .doTry and .doCatch(IOException.class) blocks, it never goes inside .doCatch(). Is exception from "abc" method is not being propagated to camel route? Why does it not go inside doCatc

Re: onException in camel

2013-06-27 Thread Christian Müller
I cannot believe it. Did you had a look at our unit tests [1]? [1] https://git-wip-us.apache.org/repos/asf?p=camel.git;a=tree;f=camel-core/src/test/java/org/apache/camel/processor/onexception;h=0b1ada52abb078e9e427b75cd362107557507ffc;hb=HEAD Best, Christian - Software Integratio

onException in camel

2013-06-27 Thread Tarun Kumar
My route configure method looks like this: public void configure() { onException(IOException.class).handled(true).bean(ExceptionHandler.class, "handleException"); from().process().bean(firstBean.class, "abc").process().end(); } "abc" method of firstBean throws IOException, still, "handleExc