You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "venkatesh.avula" <ve...@gmail.com> on 2014/04/01 15:05:17 UTC

Multiple Try-catch -Exception-Handling using spring DSL facing issues

Hi , I am trying to execute an example for Multiple try catch handler .
Please find below my camel route spring dsl congiguration .                                                                                      	                        	        	           	          	 			   
java.io.SQLException    			    			  			     			   java.io.IOException 			   			  			          	           	           	            	        
When I am trying to run this , by giving some wrong input , Ideally it
should either go to , E:/testError/IO or  E:/testError/SQL folders . But the
following exception is being thrown . Exception in thread "main"
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route route3
at: >>> DoTry[[DoCatch[ null -> [To[file:///E:/testError/SQL]]], DoCatch[
null -> [To[file:///E:/testError/IO]]], DoCatch[ null ->
[To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] <<<
in route: Route(route3)[[From[seda:queue:order]] -> [Unmarshal[ref:jax...
because of Definition has no children on DoTry[[DoCatch[ null ->
[To[file:///E:/testError/SQL]]], DoCatch[ null ->
[To[file:///E:/testError/IO]]], DoCatch[ null ->
[To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]]	at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1352)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:301)
at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
at
org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
at adapter.jda.AdapterClient.main(AdapterClient.java:17)Caused by:
org.apache.camel.FailedToCreateRouteException: Failed to create route route3
at: >>> DoTry[[DoCatch[ null -> [To[file:///E:/testError/SQL]]], DoCatch[
null -> [To[file:///E:/testError/IO]]], DoCatch[ null ->
[To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] <<<
in route: Route(route3)[[From[seda:queue:order]] -> [Unmarshal[ref:jax...
because of Definition has no children on DoTry[[DoCatch[ null ->
[To[file:///E:/testError/SQL]]], DoCatch[ null ->
[To[file:///E:/testError/IO]]], DoCatch[ null ->
[To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]]	at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:912)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)
at
org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:770)
at
org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914)
at
org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1670)
at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
at
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)	at
org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
at
org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228)
at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
... 8 moreCaused by: java.lang.IllegalArgumentException: Definition has no
children on DoTry[[DoCatch[ null -> [To[file:///E:/testError/SQL]]],
DoCatch[ null -> [To[file:///E:/testError/IO]]], DoCatch[ null ->
[To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]]	at
org.apache.camel.model.TryDefinition.createProcessor(TryDefinition.java:75)
at
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
at
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)
at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:909)
... 18 moreplease help me to go forward ..Thanks in advance 



--
View this message in context: http://camel.465427.n5.nabble.com/Multiple-Try-catch-Exception-Handling-using-spring-DSL-facing-issues-tp5749623.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: EXT :Re: Multiple Try-catch -Exception-Handling using spring DSL facing issues

Posted by "Urciolo, Kevin J (IS)" <Ke...@ngc.com>.

----- Original Message -----
From: Claus Ibsen [mailto:claus.ibsen@gmail.com]
Sent: Tuesday, April 01, 2014 09:14 AM
To: users@camel.apache.org <us...@camel.apache.org>
Subject: EXT :Re: Multiple Try-catch -Exception-Handling using spring DSL facing issues

Hi

See the doTry .. doCatch examples
http://camel.apache.org/try-catch-finally.html

your code is a bit wrong.

On Tue, Apr 1, 2014 at 3:05 PM, venkatesh.avula <ve...@gmail.com> wrote:
> Hi , I am trying to execute an example for Multiple try catch handler .
> Please find below my camel route spring dsl congiguration .
> java.io.SQLException                                                                                                       java.io.IOException
> When I am trying to run this , by giving some wrong input , Ideally it
> should either go to , E:/testError/IO or  E:/testError/SQL folders . But the
> following exception is being thrown . Exception in thread "main"
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.FailedToCreateRouteException: Failed to create route route3
> at: >>> DoTry[[DoCatch[ null -> [To[file:///E:/testError/SQL]]], DoCatch[
> null -> [To[file:///E:/testError/IO]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] <<<
> in route: Route(route3)[[From[seda:queue:order]] -> [Unmarshal[ref:jax...
> because of Definition has no children on DoTry[[DoCatch[ null ->
> [To[file:///E:/testError/SQL]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1352)
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
> at
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:301)
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
> at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
> at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
> at
> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
> at
> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
> at adapter.jda.AdapterClient.main(AdapterClient.java:17)Caused by:
> org.apache.camel.FailedToCreateRouteException: Failed to create route route3
> at: >>> DoTry[[DoCatch[ null -> [To[file:///E:/testError/SQL]]], DoCatch[
> null -> [To[file:///E:/testError/IO]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] <<<
> in route: Route(route3)[[From[seda:queue:order]] -> [Unmarshal[ref:jax...
> because of Definition has no children on DoTry[[DoCatch[ null ->
> [To[file:///E:/testError/SQL]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:912)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)
> at
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:770)
> at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1670)
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
> at
> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
> at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)        at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
> at
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228)
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
> ... 8 moreCaused by: java.lang.IllegalArgumentException: Definition has no
> children on DoTry[[DoCatch[ null -> [To[file:///E:/testError/SQL]]],
> DoCatch[ null -> [To[file:///E:/testError/IO]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] at
> org.apache.camel.model.TryDefinition.createProcessor(TryDefinition.java:75)
> at
> org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
> at
> org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:909)
> ... 18 moreplease help me to go forward ..Thanks in advance
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Multiple-Try-catch-Exception-Handling-using-spring-DSL-facing-issues-tp5749623.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io

Re: Multiple Try-catch -Exception-Handling using spring DSL facing issues

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

See the doTry .. doCatch examples
http://camel.apache.org/try-catch-finally.html

your code is a bit wrong.

On Tue, Apr 1, 2014 at 3:05 PM, venkatesh.avula <ve...@gmail.com> wrote:
> Hi , I am trying to execute an example for Multiple try catch handler .
> Please find below my camel route spring dsl congiguration .
> java.io.SQLException                                                                                                       java.io.IOException
> When I am trying to run this , by giving some wrong input , Ideally it
> should either go to , E:/testError/IO or  E:/testError/SQL folders . But the
> following exception is being thrown . Exception in thread "main"
> org.apache.camel.RuntimeCamelException:
> org.apache.camel.FailedToCreateRouteException: Failed to create route route3
> at: >>> DoTry[[DoCatch[ null -> [To[file:///E:/testError/SQL]]], DoCatch[
> null -> [To[file:///E:/testError/IO]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] <<<
> in route: Route(route3)[[From[seda:queue:order]] -> [Unmarshal[ref:jax...
> because of Definition has no children on DoTry[[DoCatch[ null ->
> [To[file:///E:/testError/SQL]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1352)
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:120)
> at
> org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:301)
> at
> org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:96)
> at
> org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
> at
> org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:948)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482)
> at
> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:139)
> at
> org.springframework.context.support.ClassPathXmlApplicationContext.(ClassPathXmlApplicationContext.java:83)
> at adapter.jda.AdapterClient.main(AdapterClient.java:17)Caused by:
> org.apache.camel.FailedToCreateRouteException: Failed to create route route3
> at: >>> DoTry[[DoCatch[ null -> [To[file:///E:/testError/SQL]]], DoCatch[
> null -> [To[file:///E:/testError/IO]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] <<<
> in route: Route(route3)[[From[seda:queue:order]] -> [Unmarshal[ref:jax...
> because of Definition has no children on DoTry[[DoCatch[ null ->
> [To[file:///E:/testError/SQL]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:912)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:177)
> at
> org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:770)
> at
> org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1914)
> at
> org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1670)
> at
> org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1544)
> at
> org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:179)
> at org.apache.camel.support.ServiceSupport.start(ServiceSupport.java:61)        at
> org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
> at
> org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:228)
> at
> org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:118)
> ... 8 moreCaused by: java.lang.IllegalArgumentException: Definition has no
> children on DoTry[[DoCatch[ null -> [To[file:///E:/testError/SQL]]],
> DoCatch[ null -> [To[file:///E:/testError/IO]]], DoCatch[ null ->
> [To[file:///E:/testError/IO]]], DoFinally[[To[file:///E:/testError]]]]] at
> org.apache.camel.model.TryDefinition.createProcessor(TryDefinition.java:75)
> at
> org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
> at
> org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)
> at
> org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:909)
> ... 18 moreplease help me to go forward ..Thanks in advance
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Multiple-Try-catch-Exception-Handling-using-spring-DSL-facing-issues-tp5749623.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io