Thomas Gantenbein created CAMEL-21780:
-----------------------------------------

             Summary: StackOverflowError at context startup
                 Key: CAMEL-21780
                 URL: https://issues.apache.org/jira/browse/CAMEL-21780
             Project: Camel
          Issue Type: Bug
    Affects Versions: 4.10.0
            Reporter: Thomas Gantenbein


A RouteBuilder with the following routes:
{code:java}
from("timer:foo?period=1000")
    .choice()
        .when().constant(true)
            .enrich()
                .constant("direct:test")
            .end()
            .id("I am trouble for version 4.10.0 -- remove me or change to 
4.9.0 and the route starts up just fine")
    .end()
    .log("${body}");from("direct:test")
    .setBody(constant("I'm running"));
 {code}
results in the following Exception at startup:
{code:java}
Exception in thread "main" java.lang.StackOverflowError
    at 
org.apache.camel.model.ProcessorDefinition.id(ProcessorDefinition.java:674)
    at org.apache.camel.model.ExpressionNode.id(ExpressionNode.java:157)
    at org.apache.camel.model.ExpressionNode.id(ExpressionNode.java:39)
    at 
org.apache.camel.model.ProcessorDefinition.id(ProcessorDefinition.java:680)
    at org.apache.camel.model.ExpressionNode.id(ExpressionNode.java:157)
    at org.apache.camel.model.ExpressionNode.id(ExpressionNode.java:39)
    at 
org.apache.camel.model.ProcessorDefinition.id(ProcessorDefinition.java:680)
 {code}
Remove the .id there or downgrade to Camel 4.9.0 and the exception is gone.It 
seems to be something about the combination of the choice and enrich EIP: 
Remove the choice and things will be fine. Replace enrich with some processor 
and things will be fine, too.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to