It’s look like an issue of JRuby, I reproduced the issue with JRuby 1.7.13, and the test was passed with JRuby 1.7.16.
-- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (English) http://jnn.iteye.com (Chinese) Twitter: willemjiang Weibo: 姜宁willem On November 28, 2014 at 11:32:58 AM, Willem Jiang (willem.ji...@gmail.com) wrote: > Which version of JRuby are you using? > I just ran the test in Camel master (2.15-SNAPSHOT) with JDK8 and JDK7, all > tests are passed. > > -- > Willem Jiang > > Red Hat, Inc. > Web: http://www.redhat.com > Blog: http://willemjiang.blogspot.com (English) > http://jnn.iteye.com (Chinese) > Twitter: willemjiang > Weibo: 姜宁willem > > > > On November 27, 2014 at 8:59:26 PM, Christoph Spenler > (christoph.spen...@worldline.com) > wrote: > > Hi, > > > > after moving from Camel 2.8 to 2.14 I am facing a problem with the language > > component and ruby scripts. With concurrentConsumer > 1, a NPE is thrown by > > the RubyInstanceConfig class: > > java.lang.NullPointerException > > at org.jruby.RubyInstanceConfig.(RubyInstanceConfig.java:1432) > > at > > org.jruby.embed.internal.AbstractLocalContextProvider.(AbstractLocalContextProvider.java:42) > > > > at > > org.jruby.embed.internal.SingletonLocalContextProvider.(SingletonLocalContextProvider.java:88) > > > > at > > org.jruby.embed.ScriptingContainer.getProviderInstance(ScriptingContainer.java:246) > > > > at org.jruby.embed.ScriptingContainer.(ScriptingContainer.java:226) > > at > > org.jruby.embed.jsr223.JRubyEngineFactory.getScriptEngine(JRubyEngineFactory.java:170) > > > > at > > org.apache.camel.builder.script.ScriptBuilder.(ScriptBuilder.java:136) > > at > > org.apache.camel.builder.script.ScriptBuilder.(ScriptBuilder.java:89) > > at > > org.apache.camel.builder.script.ScriptLanguage.createExpression(ScriptLanguage.java:40) > > > > at > > org.apache.camel.component.language.LanguageProducer.process(LanguageProducer.java:85) > > > > at > > org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) > > > > at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:120) > > > > 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.seda.SedaConsumer.sendToConsumers(SedaConsumer.java:291) > > > > at > > org.apache.camel.component.seda.SedaConsumer.doRun(SedaConsumer.java:200) > > at org.apache.camel.component.seda.SedaConsumer.run(SedaConsumer.java:147) > > at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) > > at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) > > at java.lang.Thread.run(Unknown Source) > > > > This worked fine with Camel 2.8. > > I played with some of the ruby system properties like > > System.setProperty("org.jruby.embed.localcontext.scope", "threadsafe") > > but without success. > > I have attached a unit test to demonstrate the problem. > > ConcurrentJRubyTest.java > > > > The test passes with Camel 2.8, but fails with Camel 2.14. > > > > Any ideas how to solve this? > > > > Regards > > Christoph > > > > > > > > > > > > > > -- > > View this message in context: > > http://camel.465427.n5.nabble.com/NPE-with-language-ruby-and-concurrentConsumers-tp5759703.html > > > > Sent from the Camel - Users mailing list archive at Nabble.com. > > > >