camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bovas <bovas.t...@gmail.com>
Subject Re: bean, collections in parameters - groovy
Date Thu, 02 May 2013 10:11:29 GMT
Thanks for your anwsers. But I don't success.

I use the default Camel registry (jndiContext)

*def jndiContext = new JndiContext()
def mymap= [:]
mymap["Mode"]="Zip"
mymap["test"]="test"
jndiContext.bind("myMap",mymap)*


from("file://path")
.to("bean://myclass?method=myFonction(${ref:myMap})")

=> console
Caught: groovy.lang.MissingFieldException: No such field: myMap for class:
Main.CamelProcess
groovy.lang.MissingFieldException: No such field: myMap for class:
Main.CamelProcess
	at Main.CamelProcess.this$dist$get$3(CamelProcess.groovy)
	at Main.CamelProcess$1.propertyMissing(CamelProcess.groovy)
	at Main.CamelProcess$1.getProperty(CamelProcess.groovy)
	at Main.CamelProcess$_1_configure_closure1.doCall(CamelProcess.groovy:44)
	at Main.CamelProcess$_1_configure_closure1.doCall(CamelProcess.groovy)
	at Main.CamelProcess$1.configure(CamelProcess.groovy:44)
	at
org.apache.camel.builder.RouteBuilder.checkInitialized(RouteBuilder.java:322)
	at
org.apache.camel.builder.RouteBuilder.configureRoutes(RouteBuilder.java:276)
	at
org.apache.camel.builder.RouteBuilder.addRoutesToCamelContext(RouteBuilder.java:262)
	at
org.apache.camel.impl.DefaultCamelContext.addRoutes(DefaultCamelContext.java:649)
	at org.apache.camel.CamelContext$addRoutes.call(Unknown Source)
	at Main.CamelProcess.run(CamelProcess.groovy:39)

other test :
1) 
.to("bean://myclass?method=myFonction(${ref:jndiContext})")

=> console
org.apache.camel.util.jndi.JndiContext@55e29b99

i try to display jndiContext.lookup('myMap') but nothing

2) 
.to("bean://verbes?method=myFonction(${ref:jndiContext.lookup('myMap')})")

=> console 
[Mode:Zip


I forget something with the *ref function from simple *? 

i don't find the solution... so I'm going to do another way



--
View this message in context: http://camel.465427.n5.nabble.com/bean-collections-in-parameters-groovy-tp5731778p5731904.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message