Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7189

IAE when you have a nested placeholder that starts and ends with {{ and }}

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.12.2
    • 2.12.4, 2.13.2, 2.14.0
    • camel-core
    • None
    • Unknown

    Description

      Test case: https://gist.github.com/mattnathan/7706ebdce8aa51ebc3c6

      When you have a uri that has a placeholder in it and that placeholder is of the form {{prefix}}something{{suffix}} then you get an IllegalArgumentException of the form:

      org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>> To[{{value}}] <<< in route: Route(route1)[[From[direct:test]] -> [To[{{value}}]]] because of Expecting }} but found end of string from text: scheme}}:{{path
      	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.support.ServiceSupport.start(ServiceSupport.java:61)
      	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1512)
      	at org.apache.camel.test.junit4.CamelTestSupport.startCamelContext(CamelTestSupport.java:477)
      	at org.apache.camel.test.junit4.CamelTestSupport.doSetUp(CamelTestSupport.java:311)
      	at org.apache.camel.test.junit4.CamelTestSupport.setUp(CamelTestSupport.java:217)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
      	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:74)
      	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:202)
      	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
      Caused by: java.lang.IllegalArgumentException: Expecting }} but found end of string from text: scheme}}:{{path
      	at org.apache.camel.component.properties.DefaultPropertiesParser.doParseUri(DefaultPropertiesParser.java:90)
      	at org.apache.camel.component.properties.DefaultPropertiesParser.parseUri(DefaultPropertiesParser.java:51)
      	at org.apache.camel.component.properties.DefaultPropertiesParser.parseUri(DefaultPropertiesParser.java:38)
      	at org.apache.camel.component.properties.DefaultPropertiesParser.createPlaceholderPart(DefaultPropertiesParser.java:189)
      	at org.apache.camel.component.properties.DefaultPropertiesParser.doParseUri(DefaultPropertiesParser.java:105)
      	at org.apache.camel.component.properties.DefaultPropertiesParser.parseUri(DefaultPropertiesParser.java:51)
      	at org.apache.camel.component.properties.PropertiesComponent.parseUri(PropertiesComponent.java:160)
      	at org.apache.camel.component.properties.PropertiesComponent.parseUri(PropertiesComponent.java:119)
      	at org.apache.camel.impl.DefaultCamelContext.resolvePropertyPlaceholders(DefaultCamelContext.java:1128)
      	at org.apache.camel.model.ProcessorDefinition.resolvePropertyPlaceholders(ProcessorDefinition.java:572)
      	at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:475)
      	at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)
      	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:909)
      	... 40 more
      

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              mattnathan Matt Nathan
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: