camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Mulder" <ammul...@alumni.princeton.edu>
Subject Re: Ruby expressions in Camel
Date Tue, 01 Jul 2008 01:49:37 GMT
Update: I found newer JSR223 integration code here:
https://scripting.dev.java.net/servlets/ProjectDocumentList

Now I can get Ruby to run.  Sadly, I can't get an expression working.
It seems like no matter what I do I get:

Failed to evaluate: ruby: .... Cause: org.jruby.exceptions.RaiseException

Not too informative.  (Well, it gave me some different error about kIN
when I tried the expression starting with in.headers, I assume because
in is a reserved word.  But everything else gives RaiseException.)
I've tried request.headers['foo'] == 'Bar' and exchange and
exchange.in.headers and so on.

So, any help on the syntax for Ruby expressions?

Thanks,
      Aaron


On Mon, Jun 30, 2008 at 5:37 PM, Aaron Mulder
<ammulder@alumni.princeton.edu> wrote:
> Has anyone gotten Ruby expressions working in Camel?
>
> Using Camel 1.3 and Java 1.6, I've tried adding:
>  * camel-script 1.3.0
>  * http://repo.logicblaze.com/maven2-all/javax/script/jruby-engine/1.0/jruby-engine-1.0-jdk14.jar
> (per the camel-script POM)
>  * jruby.jar from JRuby 1.0.3 and 1.1.2
>
> I get this:
>
> java.lang.NoSuchMethodError:
> org.jruby.Ruby.getDefaultInstance()Lorg/jruby/IRuby;
>        at com.sun.script.jruby.JRubyScriptEngine.init(JRubyScriptEngine.java:385)
>        at com.sun.script.jruby.JRubyScriptEngine.<init>(JRubyScriptEngine.java:54)
>        at com.sun.script.jruby.JRubyScriptEngineFactory.getScriptEngine(JRubyScriptEngineFactory.java:131)
>        at javax.script.ScriptEngineManager.getEngineByName(ScriptEngineManager.java:225)
>        at org.apache.camel.builder.script.ScriptBuilder.createScriptEngine(ScriptBuilder.java:462)
>        at org.apache.camel.builder.script.ScriptBuilder.checkInitialised(ScriptBuilder.java:447)
>        at org.apache.camel.builder.script.ScriptBuilder.getEngine(ScriptBuilder.java:379)
>        at org.apache.camel.builder.script.ScriptBuilder.getScriptContext(ScriptBuilder.java:422)
>        at org.apache.camel.builder.script.ScriptBuilder.evaluateScript(ScriptBuilder.java:484)
>        at org.apache.camel.builder.script.ScriptBuilder.matches(ScriptBuilder.java:82)
>        at org.apache.camel.builder.script.ScriptBuilder.matches(ScriptBuilder.java:49)
>        at org.apache.camel.processor.ChoiceProcessor.process(ChoiceProcessor.java:47)
>        at org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
>        at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:143)
>        at org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:87)
>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
>        at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)
>        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:40)
>        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:44)
>        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:68)
>        at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:66)
>        at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:531)
>        at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:466)
>        at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:435)
>        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:316)
>        at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:235)
>        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:887)
>        at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:822)
>        at java.lang.Thread.run(Thread.java:637)
>
> Any pointers would be appreciated.
>
> Thanks,
>      Aaron
>

Mime
View raw message