Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 42497 invoked from network); 14 Aug 2009 12:52:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Aug 2009 12:52:49 -0000 Received: (qmail 10629 invoked by uid 500); 14 Aug 2009 12:52:55 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 10595 invoked by uid 500); 14 Aug 2009 12:52:55 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 10585 invoked by uid 99); 14 Aug 2009 12:52:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Aug 2009 12:52:55 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of claus.ibsen@gmail.com designates 209.85.218.228 as permitted sender) Received: from [209.85.218.228] (HELO mail-bw0-f228.google.com) (209.85.218.228) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Aug 2009 12:52:42 +0000 Received: by bwz28 with SMTP id 28so1146643bwz.6 for ; Fri, 14 Aug 2009 05:52:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=uBUoNmvRPLZS9rLKK0PTdu8T5aDC9Eqij7KTPDZB6fg=; b=Oa3PWhtYzyYTp4mapKOIEwO4xM6e69retkVt5/ZI8gMGFFhXM3qWo8FZwx0amPrIUG terX77OljtkVuTbZ1gq7AOBSTn4jhpqDxwxOpzqYhhYq5U98iDQziDDmseEmRo6Modji g0dc/urpANMI8MMimcBZA7fAnUSum9BLCWisE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=rOYdje75BjgatXgL3ejdzeAsYGNOzuJRokCPe9/p/DeM6zpfJ3LmckpUbahwcOXcGY sJeQhesj8zKvmDQbPInAbX8LoLIA7S+41QnLHyrVxpPy5BPbwNAOj3kPk2UhOczgL4OP Dj55Kn2PD4WjILItVvRE9lzUyIZaof/WAP25c= MIME-Version: 1.0 Received: by 10.204.103.145 with SMTP id k17mr1205458bko.10.1250254342123; Fri, 14 Aug 2009 05:52:22 -0700 (PDT) In-Reply-To: References: <5380c69c0908140144h3851f736u6dac7c2f02935870@mail.gmail.com> <5380c69c0908140150g3a2a3958g9a0ea0abeb6da622@mail.gmail.com> From: Claus Ibsen Date: Fri, 14 Aug 2009 14:52:02 +0200 Message-ID: <5380c69c0908140552r8728bfcg247aadd10ae77b5c@mail.gmail.com> Subject: Re: Try/catch with split To: users@camel.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org You need try .. catch around the template when you send a message as you do NOT handle the exception and thus the client get this exception back. On Fri, Aug 14, 2009 at 2:43 PM, Charles Moulliard wr= ote: > I have adapted the test case as you propose but it fails. > > org.apache.camel.CamelExecutionException: Exception occured during execut= ion > on the exchange: Exchange[Message: Hello Willem] > =A0 =A0at > org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelp= er.java:1027) > =A0 =A0at > org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.jav= a:479) > =A0 =A0at > org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultPr= oducerTemplate.java:431) > =A0 =A0at > org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultPr= oducerTemplate.java:427) > =A0 =A0at > org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTem= plate.java:112) > =A0 =A0at > org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTem= plate.java:117) > =A0 =A0at > org.apache.camel.processor.SplitterTryCatchErrorTest.testSplitWithError(S= plitterTryCatchErrorTest.java:38) > =A0 =A0at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > =A0 =A0at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :39) > =A0 =A0at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:25) > =A0 =A0at java.lang.reflect.Method.invoke(Method.java:597) > =A0 =A0at junit.framework.TestCase.runTest(TestCase.java:164) > =A0 =A0at junit.framework.TestCase.runBare(TestCase.java:130) > =A0 =A0at junit.framework.TestResult$1.protect(TestResult.java:106) > =A0 =A0at junit.framework.TestResult.runProtected(TestResult.java:124) > =A0 =A0at junit.framework.TestResult.run(TestResult.java:109) > =A0 =A0at junit.framework.TestCase.run(TestCase.java:120) > =A0 =A0at junit.framework.TestSuite.runTest(TestSuite.java:230) > =A0 =A0at junit.framework.TestSuite.run(TestSuite.java:225) > =A0 =A0at > org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUni= t3TestReference.java:130) > =A0 =A0at > org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.jav= a:38) > =A0 =A0at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTes= tRunner.java:460) > =A0 =A0at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTes= tRunner.java:673) > =A0 =A0at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunn= er.java:386) > =A0 =A0at > org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRun= ner.java:196) > Caused by: java.lang.Exception: This is a dummy error James! > =A0 =A0at > org.apache.camel.processor.SplitterTryCatchErrorTest$GenerateError.dummyE= xception(SplitterTryCatchErrorTest.java:73) > =A0 =A0at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > =A0 =A0at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java= :39) > =A0 =A0at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorI= mpl.java:25) > =A0 =A0at java.lang.reflect.Method.invoke(Method.java:597) > =A0 =A0at > org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:193) > =A0 =A0at > org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:115) > =A0 =A0at > org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:= 122) > =A0 =A0at > org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java= :95) > =A0 =A0at > org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:= 65) > =A0 =A0at > org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.jav= a:81) > =A0 =A0at > org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.jav= a:78) > =A0 =A0at > org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:141) > =A0 =A0at > org.apache.camel.processor.SendProcessor.process(SendProcessor.java:78) > =A0 =A0at > org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:148= ) > =A0 =A0at org.apache.camel.processor.Pipeline.process(Pipeline.java:74) > =A0 =A0at org.apache.camel.processor.TryProcessor.process(TryProcessor.ja= va:63) > =A0 =A0at > org.apache.camel.management.InstrumentationProcessor.process(Instrumentat= ionProcessor.java:61) > =A0 =A0at > org.apache.camel.management.InstrumentationProcessor.process(Instrumentat= ionProcessor.java:61) > =A0 =A0at > org.apache.camel.processor.RedeliveryErrorHandler.processExchange(Redeliv= eryErrorHandler.java:186) > =A0 =A0at > org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(Red= eliveryErrorHandler.java:155) > =A0 =A0at > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryError= Handler.java:88) > =A0 =A0at > org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandle= r.java:49) > =A0 =A0at > org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:148= ) > =A0 =A0at > org.apache.camel.processor.MulticastProcessor.doProcessSequntiel(Multicas= tProcessor.java:189) > =A0 =A0at > org.apache.camel.processor.MulticastProcessor.process(MulticastProcessor.= java:126) > =A0 =A0at > org.apache.camel.processor.RedeliveryErrorHandler.processExchange(Redeliv= eryErrorHandler.java:186) > =A0 =A0at > org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(Red= eliveryErrorHandler.java:155) > =A0 =A0at > org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryError= Handler.java:88) > =A0 =A0at > org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandle= r.java:49) > =A0 =A0at > org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:148= ) > =A0 =A0at > org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProc= essor.java:54) > =A0 =A0at > org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.ja= va:48) > =A0 =A0at > org.apache.camel.component.direct.DirectProducer.process(DirectProducer.j= ava:45) > =A0 =A0at > org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:170= ) > =A0 =A0at > org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:155= ) > =A0 =A0at > org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:141) > =A0 =A0at > org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:155) > =A0 =A0at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:93) > =A0 =A0at > org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplat= e.java:97) > =A0 =A0at > org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTem= plate.java:110) > =A0 =A0... 20 more > > > > CODE ******************************************************** > > import org.apache.camel.ContextTestSupport; > import org.apache.camel.Exchange; > import org.apache.camel.builder.RouteBuilder; > import org.apache.camel.component.mock.MockEndpoint; > import org.apache.camel.impl.JndiRegistry; > > /** > =A0* @version $Revision: 736555 $ > =A0*/ > public class SplitterTryCatchErrorTest extends ContextTestSupport { > > =A0 public void testSplitWithError() throws Exception { > =A0 =A0 =A0 =A0MockEndpoint error =3D getMockEndpoint("mock:error"); > =A0 =A0 =A0 =A0error.expectedBodiesReceived("James"); > =A0 =A0 =A0 =A0error.message(0).property(Exchange.EXCEPTION_CAUGHT).conta= ins("This > is a dummy error James!"); > > =A0 =A0 =A0 =A0MockEndpoint result =3D getMockEndpoint("mock:result"); > =A0 =A0 =A0 =A0result.expectedBodiesReceived("Hello Claus", "Hello Willem= "); > > =A0 =A0 =A0 =A0template.sendBody("direct:startWithError", "Claus@James@Wi= llem"); > > =A0 =A0 =A0 =A0assertMockEndpointsSatisfied(); > =A0 =A0} > > =A0 =A0protected JndiRegistry createRegistry() throws Exception { > =A0 =A0 =A0 =A0JndiRegistry jndi =3D super.createRegistry(); > =A0 =A0 =A0 =A0jndi.bind("error", new GenerateError()); > =A0 =A0 =A0 =A0return jndi; > =A0 =A0} > > =A0 =A0protected RouteBuilder createRouteBuilder() { > =A0 =A0 =A0 =A0return new RouteBuilder() { > =A0 =A0 =A0 =A0 =A0 =A0public void configure() { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0from("direct:startWithError") > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.split(body().tokenize("@")) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.doTry() > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// GENERATE A DUMMY ERROR > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.to("bean:error") > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.to("mock:result") > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .doCatch(java.lang.Exception.= class).handled(false) > > .to("log:org.apache.camel.processor?level=3DINFO&multiline=3Dtrue&showExc= eption=3Dtrue&showCaughtException=3Dtrue&showStackTrace=3Dfalse") > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .to("mock:error") > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.end(); > =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0}; > =A0 =A0} > > =A0 =A0public static final class GenerateError { > =A0 =A0 =A0 =A0public GenerateError() { > =A0 =A0 =A0 =A0 =A0 =A0// Helper Class > =A0 =A0 =A0 =A0} > > =A0 =A0 =A0 =A0public String dummyException(String payload) throws Except= ion { > =A0 =A0 =A0 =A0 =A0 =A0if (payload.equals("James")) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0throw new Exception("This is a dummy error= James!"); > =A0 =A0 =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0 =A0 =A0return "Hello " + payload; > =A0 =A0 =A0 =A0} > > =A0 =A0} > > > } > > ******************************************** > > Here is the trace of the log > > 2009-08-14 14:34:57,726 [main =A0 =A0 =A0 =A0 =A0 ] INFO > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- JMX enabled. Using > InstrumentationLifecycleStrategy. > 2009-08-14 14:34:57,882 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > SplitterTryCatchErrorTest =A0 =A0 =A0- Using created route builder: Route= s: [] > 2009-08-14 14:34:57,882 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- Adding routes from builder: = Routes: [] > 2009-08-14 14:34:58,132 [main =A0 =A0 =A0 =A0 =A0 ] INFO > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- Apache Camel =A0(CamelContex= t:camel-1) is > starting > 2009-08-14 14:34:58,132 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultProducerServicePool =A0 =A0 - Starting service pool: > org.apache.camel.impl.DefaultProducerServicePool@b02efa > 2009-08-14 14:34:58,601 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultComponentResolver =A0 =A0 =A0 - Found component: direct via type: > org.apache.camel.component.direct.DirectComponent via: > META-INF/services/org/apache/camel/component/direct > 2009-08-14 14:34:58,601 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultComponent =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Creating endpoint > uri=3D[direct://startWithError], path=3D[startWithError], parameters=3D[{= }] > 2009-08-14 14:34:58,616 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- direct://startWithError conv= erted to > endpoint: Endpoint[direct://startWithError] by component: > org.apache.camel.component.direct.DirectComponent@1e0f2f6 > 2009-08-14 14:34:58,695 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultComponentResolver =A0 =A0 =A0 - Found component: bean via type: > org.apache.camel.component.bean.BeanComponent via: > META-INF/services/org/apache/camel/component/bean > 2009-08-14 14:34:58,710 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultComponent =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Creating endpoint uri=3D[b= ean://error], > path=3D[error], parameters=3D[{}] > 2009-08-14 14:34:58,726 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- bean://error converted to en= dpoint: > Endpoint[bean://error] by component: > org.apache.camel.component.bean.BeanComponent@1c0f2e5 > 2009-08-14 14:34:58,773 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultComponentResolver =A0 =A0 =A0 - Found component: mock via type: > org.apache.camel.component.mock.MockComponent via: > META-INF/services/org/apache/camel/component/mock > 2009-08-14 14:34:58,773 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultComponent =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Creating endpoint uri=3D[m= ock://result], > path=3D[result], parameters=3D[{}] > 2009-08-14 14:34:58,788 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- mock://result converted to e= ndpoint: > Endpoint[mock://result] by component: > org.apache.camel.component.mock.MockComponent@1977b9b > 2009-08-14 14:34:58,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultComponentResolver =A0 =A0 =A0 - Found component: log via type: > org.apache.camel.component.log.LogComponent via: > META-INF/services/org/apache/camel/component/log > 2009-08-14 14:34:58,851 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultComponent =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Creating endpoint > uri=3D[log://org.apache.camel.processor?level=3DINFO&multiline=3Dtrue&sho= wCaughtException=3Dtrue&showException=3Dtrue&showStackTrace=3Dfalse], > path=3D[org.apache.camel.processor], parameters=3D[{level=3DINFO, multili= ne=3Dtrue, > showCaughtException=3Dtrue, showException=3Dtrue, showStackTrace=3Dfalse}= ] > 2009-08-14 14:34:58,882 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- > log://org.apache.camel.processor?level=3DINFO&multiline=3Dtrue&showCaught= Exception=3Dtrue&showException=3Dtrue&showStackTrace=3Dfalse > converted to endpoint: > Endpoint[log://org.apache.camel.processor?level=3DINFO&multiline=3Dtrue&s= howCaughtException=3Dtrue&showException=3Dtrue&showStackTrace=3Dfalse] > by component: org.apache.camel.component.log.LogComponent@1a7ddcf > 2009-08-14 14:34:58,882 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultComponent =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Creating endpoint uri=3D[m= ock://error], > path=3D[error], parameters=3D[{}] > 2009-08-14 14:34:58,882 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- mock://error converted to en= dpoint: > Endpoint[mock://error] by component: > org.apache.camel.component.mock.MockComponent@1977b9b > 2009-08-14 14:34:58,976 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- Starting routes > 2009-08-14 14:34:59,116 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DirectConsumer =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Starting consumer: > Consumer[direct://startWithError] > 2009-08-14 14:34:59,116 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- Route 0: > EventDrivenConsumerRoute[Endpoint[direct://startWithError] -> > UnitOfWork(Channel[Splitter[on: tokenize(body, @) to: Channel[Try > {Pipeline[Channel[sendTo(Endpoint[bean://error])], > Channel[sendTo(Endpoint[mock://result])]]} [Catch[[class > java.lang.Exception] -> > Pipeline[Channel[sendTo(Endpoint[log://org.apache.camel.processor?level= =3DINFO&multiline=3Dtrue&showCaughtException=3Dtrue&showException=3Dtrue&sh= owStackTrace=3Dfalse])], > Channel[sendTo(Endpoint[mock://error])]]]]] aggregate: > useLatestAggregationStrategy]])] > 2009-08-14 14:34:59,116 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- Started routes > 2009-08-14 14:34:59,116 [main =A0 =A0 =A0 =A0 =A0 ] INFO > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- Apache Camel =A0(CamelContex= t:camel-1) > started > 2009-08-14 14:34:59,163 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DirectProducer =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Starting producer: > Producer[direct://startWithError] > 2009-08-14 14:34:59,179 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > ProducerCache =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Adding to producer cac= he with key: > Endpoint[direct://startWithError] for producer: > Producer[direct://startWithError] > 2009-08-14 14:34:59,304 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > ProducerCache =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- >>>> Endpoint[direct:/= /startWithError] > Exchange[Message: Claus@James@Willem] > 2009-08-14 14:34:59,413 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > ProcessorEndpoint$1 =A0 =A0 =A0 =A0 =A0 =A0- Starting producer: Producer[= bean://error] > 2009-08-14 14:34:59,413 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > ProducerCache =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Adding to producer cac= he with key: > Endpoint[bean://error] for producer: Producer[bean://error] > 2009-08-14 14:35:00,726 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.component.file.GenericFileConverter > 2009-08-14 14:35:00,757 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.InstanceMethodWithExchangeTestConverter > 2009-08-14 14:35:00,757 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.StaticMethodWithExchangeTestConverter > 2009-08-14 14:35:00,757 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.CamelConverter > 2009-08-14 14:35:00,757 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.CollectionConverter > 2009-08-14 14:35:00,757 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.IOConverter > 2009-08-14 14:35:00,773 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.jaxp.DomConverter > 2009-08-14 14:35:00,773 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.jaxp.StaxConverter > 2009-08-14 14:35:00,788 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.jaxp.StreamSourceConverter > 2009-08-14 14:35:00,788 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.jaxp.XmlConverter > 2009-08-14 14:35:00,788 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.NIOConverter > 2009-08-14 14:35:00,788 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.ObjectConverter > 2009-08-14 14:35:00,804 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > AnnotationTypeConverterLoader =A0- Loading converter class: > org.apache.camel.converter.stream.StreamCacheConverter > 2009-08-14 14:35:00,804 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > BeanProcessor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Setting bean invocatio= n result on the IN > message: Hello Claus > 2009-08-14 14:35:00,804 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > BeanProcessor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Setting bean invocatio= n result on the IN > message: Hello Claus > 2009-08-14 14:35:00,804 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > MockEndpoint$1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Starting producer: Produ= cer[mock://result] > 2009-08-14 14:35:00,804 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > ProducerCache =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Adding to producer cac= he with key: > Endpoint[mock://result] for producer: Producer[mock://result] > 2009-08-14 14:35:00,820 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > MockEndpoint =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - mock://result >>>> 1 := Exchange[Message: > Hello Claus] with body: Hello Claus > 2009-08-14 14:35:00,820 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > Pipeline =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Message exchange h= as failed so breaking out > of pipeline: Exchange[Message: James] Exception: java.lang.Exception: Thi= s > is a dummy error James! > 2009-08-14 14:35:00,820 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > ProcessorEndpoint$1 =A0 =A0 =A0 =A0 =A0 =A0- Starting producer: > Producer[log://org.apache.camel.processor?level=3DINFO&multiline=3Dtrue&s= howCaughtException=3Dtrue&showException=3Dtrue&showStackTrace=3Dfalse] > 2009-08-14 14:35:00,820 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > ProducerCache =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Adding to producer cac= he with key: > Endpoint[log://org.apache.camel.processor?level=3DINFO&multiline=3Dtrue&s= howCaughtException=3Dtrue&showException=3Dtrue&showStackTrace=3Dfalse] > for producer: > Producer[log://org.apache.camel.processor?level=3DINFO&multiline=3Dtrue&s= howCaughtException=3Dtrue&showException=3Dtrue&showStackTrace=3Dfalse] > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] INFO > processor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Exchange[ > , BodyType:String > , Body:James > , CaughtExceptionType:java.lang.Exception, CaughtExceptionMessage:This is= a > dummy error James!] > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > MockEndpoint$1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Starting producer: Produ= cer[mock://error] > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > ProducerCache =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Adding to producer cac= he with key: > Endpoint[mock://error] for producer: Producer[mock://error] > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > MockEndpoint =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - mock://error >>>> 1 : = Exchange[Message: > James] with body: James > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > TryProcessor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - The exception is handl= ed: false for the > exception: java.lang.Exception caused by: This is a dummy error James! > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultErrorHandler =A0 =A0 =A0 =A0 =A0 =A0- Failed delivery for exchange= Id: > ID-dell-charles-2915-1250253299195-0-2. On delivery attempt: 0 caught: > java.lang.Exception: This is a dummy error James! > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultErrorHandler =A0 =A0 =A0 =A0 =A0 =A0- This exchange is not handled= so its marked > as failed: Exchange[Message: James] > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > BeanProcessor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Setting bean invocatio= n result on the IN > message: Hello Willem > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > BeanProcessor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Setting bean invocatio= n result on the IN > message: Hello Willem > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > MockEndpoint =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - mock://result >>>> 2 := Exchange[Message: > Hello Willem] with body: Hello Willem > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > MulticastProcessor =A0 =A0 =A0 =A0 =A0 =A0 - Done sequientel processing 3= exchanges > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultErrorHandler =A0 =A0 =A0 =A0 =A0 =A0- Failed delivery for exchange= Id: > ID-dell-charles-2915-1250253299195-0-4. On delivery attempt: 0 caught: > java.lang.Exception: This is a dummy error James! > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultErrorHandler =A0 =A0 =A0 =A0 =A0 =A0- This exchange is not handled= so its marked > as failed: Exchange[Message: Hello Willem] > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > SplitterTryCatchErrorTest =A0 =A0 =A0- tearDown test: testSplitWithError > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] INFO > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- Apache Camel =A0(CamelContex= t:camel-1) is > stopping > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DirectConsumer =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Stopping consumer: > Consumer[direct://startWithError] > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG > DefaultProducerServicePool =A0 =A0 - Stopping service pool: > org.apache.camel.impl.DefaultProducerServicePool@b02efa > 2009-08-14 14:35:00,835 [main =A0 =A0 =A0 =A0 =A0 ] INFO > DefaultCamelContext =A0 =A0 =A0 =A0 =A0 =A0- Apache Camel =A0(CamelContex= t:camel-1) > stopped > > Regards, > > Charles Moulliard > Senior Enterprise Architect > Apache Camel Committer > > ***************************** > blog : http://cmoulliard.blogspot.com > > > On Fri, Aug 14, 2009 at 10:50 AM, Claus Ibsen wro= te: > >> Hi >> >> But Camel is smart and flexible so it allows you to lower the handled >> flag on doCatch (noticed handled(false)) so you can do like this, in >> which the client will get the exception back in his face. And the >> mock:error can see the caused exception from a property on the >> exchange >> >> =A0 =A0 =A0 =A0MockEndpoint error =3D getMockEndpoint("mock:error"); >> =A0 =A0 =A0 =A0error.expectedBodiesReceived("James"); >> =A0 =A0 =A0 =A0error.message(0).property(Exchange.EXCEPTION_CAUGHT).isNo= tNull(); >> >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0from("direct:start") >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.split(body().tokenize("@")) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.doTry() >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .to("bean:error") >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.to("mock:result") >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .doCatch(Exception.class).handle= d(false) >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.to("mock:error") >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.end(); >> >> >> On Fri, Aug 14, 2009 at 10:44 AM, Claus Ibsen >> wrote: >> > Hi >> > >> > Works fine I will commit an unit test later when Hadrian is done with >> > the build of Camel 2.0 release. >> > >> > 2 messages goes to mock:result >> > 1 message go to mock:error >> > >> > All as expected. >> > >> > Since you use doTry .. doCatch the client will not receive any >> > exception as he will not do that either when you do >> > >> > try { >> > >> > } catch (Exception e) { >> > =A0.. do something >> > } >> > >> > Since you do NOT rethrow the exception in the catch block. Catching an >> > exception is like handling it =3D NO MORE AN EXCEPTION >> > >> > >> > >> > >> > On Wed, Aug 12, 2009 at 2:53 PM, Charles Moulliard >> wrote: >> >> Hi, >> >> >> >> I'm back again with try/catch and split. I have created the following >> unit >> >> test who seems to work but I don't understand why the try/catch block= of >> the >> >> test does not receive the error ? >> >> >> >> Code >> >> >> >> package org.apache.camel.processor; >> >> >> >> import org.apache.camel.ContextTestSupport; >> >> // import org.apache.camel.RuntimeCamelException; >> >> import org.apache.camel.builder.RouteBuilder; >> >> import org.apache.camel.component.mock.MockEndpoint; >> >> import org.apache.camel.impl.JndiRegistry; >> >> >> >> public class SplitterTryCatchErrorTest extends ContextTestSupport { >> >> >> >> =A0 public void testSplitWithError() throws Exception { >> >> =A0 =A0 =A0 =A0MockEndpoint resultEndpoint =3D getMockEndpoint("mock:= error"); >> >> =A0 =A0 =A0 =A0resultEndpoint.expectedBodiesReceived("James"); >> >> >> >> =A0 =A0 =A0 =A0try { >> >> =A0 =A0 =A0 =A0 =A0 =A0template.sendBody("direct:startWithError", "Cl= aus@James >> >> @Willem"); >> >> =A0 =A0 =A0 =A0 =A0 =A0//fail("Should have thrown an exception"); >> >> =A0 =A0 =A0 =A0} catch (Exception e) { >> >> =A0 =A0 =A0 =A0 =A0 =A0assertTrue(e.getCause().getMessage().startsWit= h("This is a >> dummy >> >> error James!")); >> >> =A0 =A0 =A0 =A0} >> >> >> >> =A0 =A0 =A0 =A0assertMockEndpointsSatisfied(); >> >> =A0 =A0} >> >> >> >> >> >> =A0 =A0protected JndiRegistry createRegistry() throws Exception { >> >> =A0 =A0 =A0 =A0JndiRegistry jndi =3D super.createRegistry(); >> >> =A0 =A0 =A0 =A0jndi.bind("error", new GenerateError()); >> >> =A0 =A0 =A0 =A0return jndi; >> >> =A0 =A0} >> >> >> >> =A0 =A0protected RouteBuilder createRouteBuilder() { >> >> =A0 =A0 =A0 =A0return new RouteBuilder() { >> >> =A0 =A0 =A0 =A0 =A0 =A0public void configure() { >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0from("direct:startWithError") >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.split(body().tokenize("@")) >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.doTry() >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0// GENERATE A DUMMY ER= ROR >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.to("bean:error") >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.to("mock:result") >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .doCatch(java.lang.Except= ion.class) >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 .to("mock:error") >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.end(); >> >> >> >> =A0 =A0} >> >> >> >> =A0 =A0public static final class GenerateError { >> >> =A0 =A0 =A0 =A0public GenerateError() { >> >> =A0 =A0 =A0 =A0 =A0 =A0// Helper Class >> >> =A0 =A0 =A0 =A0} >> >> >> >> =A0 =A0 =A0 =A0public String dummyException(String payload) throws Ex= ception { >> >> =A0 =A0 =A0 =A0 =A0 =A0if (payload.equals("James")) { >> >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0throw new Exception("This is a dummy e= rror James!"); >> >> =A0 =A0 =A0 =A0 =A0 =A0} >> >> =A0 =A0 =A0 =A0 =A0 =A0return "Hello " + payload; >> >> =A0 =A0 =A0 =A0} >> >> >> >> =A0 =A0} >> >> >> >> >> >> } >> >> >> >> What I observe in the log is that the split of the body is done and e= ach >> >> message is processed individually : one for Claus, one for Willem. Fo= r >> >> James, a dummy exception is throwed. >> >> >> >> 2009-08-12 14:41:06,701 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> ProducerCache =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- >>>> Endpoint[dire= ct://startWithError] >> >> Exchange[Message: Claus@James@Willem] >> >> 2009-08-12 14:41:06,811 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> ProcessorEndpoint$1 =A0 =A0 =A0 =A0 =A0 =A0- Starting producer: >> Producer[bean://error] >> >> 2009-08-12 14:41:06,811 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> ProducerCache =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Adding to producer= cache with key: >> >> Endpoint[bean://error] for producer: Producer[bean://error] >> >> 2009-08-12 14:41:09,233 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> BeanProcessor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Setting bean invoc= ation result on the >> IN >> >> message: Hello Claus >> >> 2009-08-12 14:41:09,233 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> BeanProcessor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Setting bean invoc= ation result on the >> IN >> >> message: Hello Claus >> >> 2009-08-12 14:41:09,248 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> MockEndpoint$1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Starting producer: >> Producer[mock://result] >> >> 2009-08-12 14:41:09,248 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> ProducerCache =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Adding to producer= cache with key: >> >> Endpoint[mock://result] for producer: Producer[mock://result] >> >> 2009-08-12 14:41:09,248 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> MockEndpoint =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - mock://result >>>>= 1 : >> Exchange[Message: >> >> Hello Claus] with body: Hello Claus >> >> 2009-08-12 14:41:09,248 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> Pipeline =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Message exchan= ge has failed so breaking >> out >> >> of pipeline: Exchange[Message: James] Exception: java.lang.Exception: >> This >> >> is a dummy error James! >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> MockEndpoint$1 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Starting producer: >> Producer[mock://error] >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> ProducerCache =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Adding to producer= cache with key: >> >> Endpoint[mock://error] for producer: Producer[mock://error] >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> MockEndpoint =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - mock://error >>>> = 1 : Exchange[Message: >> >> James] with body: James >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> TryProcessor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - The exception is h= andled: true for the >> >> exception: java.lang.Exception caused by: This is a dummy error James= ! >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> BeanProcessor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Setting bean invoc= ation result on the >> IN >> >> message: Hello Willem >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> BeanProcessor =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0- Setting bean invoc= ation result on the >> IN >> >> message: Hello Willem >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> MockEndpoint =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - mock://result >>>>= 2 : >> Exchange[Message: >> >> Hello Willem] with body: Hello Willem >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> MulticastProcessor =A0 =A0 =A0 =A0 =A0 =A0 - Done sequientel processi= ng 3 exchanges >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] INFO >> >> MockEndpoint =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Asserting: Endpoin= t[mock://result] is >> >> satisfied >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] INFO >> >> MockEndpoint =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 - Asserting: Endpoin= t[mock://error] is >> >> satisfied >> >> 2009-08-12 14:41:09,264 [main =A0 =A0 =A0 =A0 =A0 ] DEBUG >> >> SplitterTryCatchErrorTest =A0 =A0 =A0- tearDown test: testSplitWithEr= ror >> >> >> >> The test succeeds but the exception is not catched in the try/catch >> block of >> >> testSplitWithError. What is wrong ? >> >> >> >> Regards, >> >> >> >> Charles >> >> >> > >> > >> > >> > -- >> > Claus Ibsen >> > Apache Camel Committer >> > >> > Open Source Integration: http://fusesource.com >> > Blog: http://davsclaus.blogspot.com/ >> > Twitter: http://twitter.com/davsclaus >> > >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> > --=20 Claus Ibsen Apache Camel Committer Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus