camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tesla <remz...@gmail.com>
Subject camel groovy error.
Date Tue, 07 Jul 2015 08:49:53 GMT
Hi I am facing a strange problem. I have some groovy code like that:

import org.apache.camel.model.language.JsonPathExpression;
import org.apache.camel.impl.DefaultExchange;

String endUserId = new
JsonPathExpression("\$.amountTransaction.endUserId").evaluate((DefaultExchange)
exchange,String.class);
exchange.setProperty("endUserId", endUserId);

It simply tries to find what is the endUserId from message body. But
sometimes camel is starting to throw this exception :

EXCEPTION groovy.lang.GroovyRuntimeException: Ambiguous method overloading
for method org.apache.camel.model.language
.JsonPathExpression#evaluate.
Cannot resolve which method to invoke for [class
org.apache.camel.impl.DefaultExchange, class java.lang.Class] due to
overlapping prototypes 
between:
        [interface org.apache.camel.Exchange, class java.lang.Class]
        [interface org.apache.camel.Exchange, class
java.lang.Class]\ngroovy.lang.GroovyRuntimeException: Ambiguous method
overloading for me
thod org.apache.camel.model.language.JsonPathExpression#evaluate.\nCannot
resolve which method to invoke for [class org.apache.camel.impl.Def
aultExchange, class java.lang.Class] due to overlapping prototypes
between:\n   [interface org.apache.camel.Exchange, class java.lang.Class]\
n       [interface org.apache.camel.Exchange, class java.lang.Class]\n  at
groovy.lang.MetaClassImpl.chooseMostSpecificParams(MetaClassImpl.j
ava:3031)\n     at
groovy.lang.MetaClassImpl.chooseMethodInternal(MetaClassImpl.java:2983)\n   
at groovy.lang.MetaClassImpl.chooseMethod(Met
aClassImpl.java:2926)\n at
groovy.lang.MetaClassImpl.getMethodWithCachingInternal(MetaClassImpl.java:1203)\n   
at groovy.lang.MetaClassImpl.
createPojoCallSite(MetaClassImpl.java:3130)\n   at
org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:129)\
n       at
org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:163)\n

at org.codehaus.groovy.runtime.callsi
te.CallSiteArray.defaultCall(CallSiteArray.java:45)\n   at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:1

I am using camel 2.13 and groovy-2.2.2. What I am doing wrong?



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

Mime
View raw message