You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Thomas Diesler (JIRA)" <ji...@apache.org> on 2015/09/28 08:53:04 UTC
[jira] [Resolved] (CAMEL-9122) Ruby script cannot access request
object
[ https://issues.apache.org/jira/browse/CAMEL-9122?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Diesler resolved CAMEL-9122.
-----------------------------------
Resolution: Fixed
Fix Version/s: (was: 2.17.0)
If we stick to a working jruby version, we can resolve this. Its no longer a bug.
> Ruby script cannot access request object
> ----------------------------------------
>
> Key: CAMEL-9122
> URL: https://issues.apache.org/jira/browse/CAMEL-9122
> Project: Camel
> Issue Type: Bug
> Components: camel-script
> Reporter: Thomas Diesler
>
> with script
> {code}
> body = $request.getBody()
> $request.setBody("Hello " + body);
> {code}
> we get
> {code}
> uby: body = $request.getBody();
> $request.setBody("Hello " + body);. Cause: org.jruby.embed.EvalFailedException: (NoMethodError) undefined method `getBody' for nil:NilClass
> at org.apache.camel.builder.script.ScriptBuilder.createScriptEvaluationException(ScriptBuilder.java:540)
> at org.apache.camel.builder.script.ScriptBuilder.evaluateScript(ScriptBuilder.java:409)
> at org.apache.camel.builder.script.ScriptBuilder.process(ScriptBuilder.java:181)
> at org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)
> at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
> at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:460)
> at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:62)
> at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:190)
> at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:109)
> at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:68)
> at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:404)
> at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:372)
> at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:262)
> at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:372)
> at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:230)
> at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:128)
> at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:132)
> at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:149)
> at org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:301)
> at org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:331)
> at org.wildfly.camel.test.script.ScriptIntegrationTest.scriptProcessing(ScriptIntegrationTest.java:100)
> at org.wildfly.camel.test.script.ScriptIntegrationTest.testRuby(ScriptIntegrationTest.java:75)
> {code}
> It seems that the scriptengine can load the script and that the request object is nil.
> This used to work 2.15.2 and earlier 2.16 snapshots
> CrossRef: https://github.com/wildfly-extras/wildfly-camel/issues/845
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)