camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lekkie <lekkie.ay...@gmail.com>
Subject Using properties file values with Camel Simple expression
Date Thu, 03 Jun 2010 09:06:40 GMT

I am trying to insert a value from a properties file into a simple expression
but it keeps throwing an exception

<route>
	<from uri="direct:signOut"/>
    	<transform>			
		<simple>${properties:my-host}</simple>
	</transform>
    	<to uri="nmr:HTTPService"/>
</route>

See exception below:

org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
route56 at: >>> Transform[simple{${properties:my-host}}] <<< in route:
Route[[From[direct://signOut]] -> [Transform[simple{%3CAK_BS... because of
Illegal syntax: properties:aero-host
	at
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1055)
	at
org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
	at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:593)
	at
org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
	at
org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
	at
org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
	at
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
	at
org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)

	... 12 more
Caused by: org.apache.camel.ExpressionIllegalSyntaxException: Illegal
syntax: properties:my-host
	at
org.apache.camel.language.simple.SimpleLanguage.createSimpleExpression(SimpleLanguage.java:155)
	at
org.apache.camel.language.simple.SimpleLanguageSupport.createComplexConcatExpression(SimpleLanguageSupport.java:267)
	at
org.apache.camel.language.simple.SimpleLanguageSupport.createExpression(SimpleLanguageSupport.java:69)
	at
org.apache.camel.model.language.ExpressionDefinition.createExpression(ExpressionDefinition.java:171)
	at
org.apache.camel.model.language.ExpressionDefinition.createExpression(ExpressionDefinition.java:161)
	at
org.apache.camel.model.TransformDefinition.createProcessor(TransformDefinition.java:55)
	at
org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:325)
	at
org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:137)
	at
org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:690)
	... 22 more


I went through the doc on http://camel.apache.org/simple.html and I saw
this:

properties:locations:key 	 String 	 Camel 2.3: Lookup a property with the
given key. The locations option is optional. See more at Using
PropertyPlaceholder. 

regards.
-- 
View this message in context: http://old.nabble.com/Using-properties-file-values-with-Camel-Simple-expression-tp28764992p28764992.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message