Issue with properties component
divakar Feb 14, 2011 8:34 AMHi,
I am reading the properties file using PropertyPlaceholderConfigurer and when trying to set those values in the properties present inside the camel context getting exception.
Accessing the properties file in the following manner:
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:com/resources/common.properties"/>
</bean>
I am trying to set the values inside the camel context properties as below:
<camel:camelContext id="AccessingToXXX" xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="nmr:xxx"/>
<setProperty propertyName="com.userWSName">
<simple>$</simple> </setProperty> <to uri="direct:yyy"/> </route> </camel:camelContext> The exception occured is: org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route route60 at: >>> SetProperty[http://com.userWSName, simple{$}|http://com.userwsname,%20simple%7b$%7busername%7d%7d/] <<< in route: Route[[From[nmr:xxx]|http://fusesource.com/forums/] -> [To[... because of Illegal syntax: username
at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1139)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)75:org.apache.camel.camel-spring:2.6.0.fuse-00-00
at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:237)75:org.apache.camel.camel-spring:2.6.0.fuse-00-00
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)61:org.springframework.context:3.0.5.RELEASE
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)61:org.springframework.context:3.0.5.RELEASE
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)61:org.springframework.context:3.0.5.RELEASE
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)71:org.springframework.osgi.core:1.2.0
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)71:org.springframework.osgi.core:1.2.0
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)71:org.springframework.osgi.core:1.2.0
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)71:org.springframework.osgi.core:1.2.0
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136)72:org.springframework.osgi.extender:1.2.0
at java.lang.Thread.run(Thread.java:619):1.6.0_18
Caused by: org.apache.camel.FailedToCreateRouteException: Failed to create route route60 at: >>> SetProperty[http://com.userWSName, simple{${username}}|http://com.userwsname,%20simple%7b$%7busername%7d%7d/] <<< in route: Route[[From[nmr:xxx]|http://fusesource.com/forums/] -> [To[... because of Illegal syntax: username
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:759)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:160)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:701)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1623)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1412)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1321)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:164)75:org.apache.camel.camel-spring:2.6.0.fuse-00-00
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:65)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:52)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1299)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203)75:org.apache.camel.camel-spring:2.6.0.fuse-00-00
at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)75:org.apache.camel.camel-spring:2.6.0.fuse-00-00
... 10 more
Caused by: org.apache.camel.ExpressionIllegalSyntaxException: Illegal syntax: username
at org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:314)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.language.simple.SimpleLanguageSupport.createComplexConcatExpression(SimpleLanguageSupport.java:318)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.language.simple.SimpleLanguageSupport.createExpression(SimpleLanguageSupport.java:92)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.model.language.ExpressionDefinition.createExpression(ExpressionDefinition.java:171)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.model.language.ExpressionDefinition.createExpression(ExpressionDefinition.java:161)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.model.SetPropertyDefinition.createProcessor(SetPropertyDefinition.java:72)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:403)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:174)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:756)68:org.apache.camel.camel-core:2.6.0.fuse-00-00
... 21 more
Regards,
V. Arvind