You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by labi <la...@gmail.com> on 2014/06/22 02:38:30 UTC

MissingMethodException- Inconsisent groovy closure-coercion with grails

Environment: camel 2.13, grails 2.4, groovy 2.3,
grails-plugins[${default-plugins}, routing-1.3.2], camel-context and
RouteBuilder instances defined in resources.groovy
RouteBuilder.configure: /from('direct:sysOut').setProperty('kkkk', { 'Really
nice value'}).to('stream:out')/
JUnit-Test-Method: /producerTemplate.sendBody('direct:sysOut','Testing
ClientRequestsRouteSpec: Sys XXXXX-XXXX')/
Issue: When I run the JUnit test method in eclipse (*not using* grails
test-app unit:) it works without issues (captured-stacktrace), notice that
the that groovy-closure is not cooerced and the DelegateSyncProcessor is
used.
  org.apache.camel.groovy.extend.ClosureSupport.call(ClosureSupport.java:30)
 
org.apache.camel.groovy.extend.ClosureProcessor.process(ClosureProcessor.java:37)
 
org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
 
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
 
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
 
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
  org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
  org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)
 
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
 
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:73)
  org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:378)
  org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:346)
  org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:242)
  org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:346)
  org.apache.camel.impl.ProducerCache.send(ProducerCache.java:184)
 
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:124)
 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:137)
 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:144)
  org.apache.camel.ProducerTemplate$sendBody.call(Unknown Source)
 
org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
 
org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
 
client.requests.ClientRequestsRouteSpec.testClientRequestRoute(ClientRequestsRouteSpec.groovy:107)

When I try to execute same unit-test via the grails  'test-app unit:'
command the code fails (see stacktrace below). I believe the groovy closure
coercion is used to convert the closure into an implementation of the
Expression interface.
 groovy.lang.MissingMethodException: No signature of method: 
client.requests.ClientRequestsRoute$_configure_closure6.doCall() is
applicable for argument types: (org.apache.camel.impl.DefaultExchange,
java.lang.Class) values: [Exchange[Message: Testing 
ClientRequestsRouteSpec: Sys XXXXX-XXXX], ...]
Possible solutions: doCall(), doCall(java.lang.Object), call(),
call([Ljava.lang.Object;), call(java.lang.Object), findAll()
	at
org.apache.camel.builder.ProcessorBuilder$7.process(ProcessorBuilder.java:162)
	at
org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
	at
org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
	at
org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:163)
	at
org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
	at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
	at
org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:51)
	at
org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
	at
org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:73)
	at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:378)
	at
org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:346)
	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:242)
	at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:346)
	at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:184)
	at
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:124)
	at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:137)
	at
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:144)
	at
client.requests.ClientRequestsRouteSpec.testClientRequestRoute(ClientRequestsRouteSpec.groovy:107)

When the junit-test is run via the grails 'test-app unit:' cmd, you will
notice that InstrumentationProcessor.processor field is an instance of the
AsyncProcessorConverterHelper but  when the junit-test is run directly in
eclipse the InstrumentationProcessor.processor field is an instance of
DelegateSyncProcessor. Please let me know if you need any other details.

 



--
View this message in context: http://camel.465427.n5.nabble.com/MissingMethodException-Inconsisent-groovy-closure-coercion-with-grails-tp5752658.html
Sent from the Camel - Users mailing list archive at Nabble.com.