camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Camel 2.9.0 -- StackOverflowError initializing route with otherwise() clause
Date Sat, 31 Dec 2011 05:03:29 GMT
I just tried a simple unit test[1] with the route you showed on the 
trunk, I did get the StackOverflowError,
Can I know more information about how you deploy the route and the 
version of you JDK, OSGi container?

[1]http://svn.apache.org/viewvc?rev=1226037&view=rev

Willem

On Sat Dec 31 01:45:06 2011, ilopanj wrote:
> Hi,
>
> I'm preparing to upgrade an application to 2.9.0 from 2.8.3 and found a
> problem initializing one of our existing routes defined with the Java DSL:
>
> from ("direct:outerRoute")
> 		.choice ()
> 		    .when(header("test-header").isNotNull())
> 		    	.to("direct:mainProcess")
> 		    .otherwise ()
> 		    	.to ("log:badMessage")
> 		    	.transform ()
> 		    		.method (rejectBean, "processRejectedMessage")
> 		 .end ();
>
> I get a StackOverflowError initializing the route when using version 2.9.0
> in the staging repo, but it works fine with version 2.8.3.  Here's a snippet
> of the error below:
>
> Exception in thread "SpringOsgiExtenderThread-27"
> java.lang.StackOverflowError
> 	at java.lang.Integer.toHexString(Integer.java:174)
> 	at java.lang.Object.toString(Object.java:219)
> 	at
> org.apache.camel.model.BeanDefinition.description(BeanDefinition.java:80)
> 	at org.apache.camel.model.BeanDefinition.toString(BeanDefinition.java:69)
> 	at java.lang.String.valueOf(String.java:2826)
> 	at java.lang.StringBuilder.append(StringBuilder.java:115)
> 	at java.util.AbstractCollection.toString(AbstractCollection.java:422)
> 	at java.lang.String.valueOf(String.java:2826)
> 	at java.lang.StringBuilder.append(StringBuilder.java:115)
> 	at
> org.apache.camel.model.RouteDefinition.toString(RouteDefinition.java:116)
> 	at java.lang.String.valueOf(String.java:2826)
> 	at java.lang.StringBuilder.append(StringBuilder.java:115)
> 	at java.util.AbstractCollection.toString(AbstractCollection.java:422)
> 	at java.lang.String.valueOf(String.java:2826)
> 	at java.lang.StringBuilder.append(StringBuilder.java:115)
> 	at
> org.apache.camel.model.RoutesDefinition.toString(RoutesDefinition.java:60)
> 	at org.apache.camel.builder.RouteBuilder.toString(RouteBuilder.java:58)
> 	at
> org.apache.camel.language.bean.BeanExpression.toString(BeanExpression.java:68)
> 	at
> org.apache.camel.model.language.ExpressionDefinition.toString(ExpressionDefinition.java:99)
> 	at java.lang.String.valueOf(String.java:2826)
> 	at java.lang.StringBuilder.append(StringBuilder.java:115)
> 	at
> org.apache.camel.model.TransformDefinition.toString(TransformDefinition.java:44)
> ... etc ...
>
> I can work around the problem by factoring the otherwise() portion into a
> separate route:
>
> from ("direct:handleBadMessage")
>      .to ("log:badMessage")
>      .transform ()
> 	.method (rejectBean, "processRejectedMessage");
>
> from ("direct:outerRoute")
> 		.choice ()
> 		    .when(header("test-header").isNotNull())
> 		    	.to("direct:mainProcess")
> 		    .otherwise ()
> 		    	.to("direct:handleBadMessage")
> 		 .end ();
>
> Thanks,
> Jerry
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-2-9-0-StackOverflowError-initializing-route-with-otherwise-clause-tp5110599p5110599.html
> Sent from the Camel Development mailing list archive at Nabble.com.
>



-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang 
Weibo: willemjiang 


Mime
View raw message