JRuby jsr223 support incompatible with OSGI (should not use currentThread().getContextClassLoader()) ----------------------------------------------------------------------------------------------------
Key: JRUBY-4806 URL: http://jira.codehaus.org/browse/JRUBY-4806 Project: JRuby Issue Type: Bug Components: Embedding Affects Versions: JRuby 1.5 Environment: Jruby 1.5 + Java 1.6+ Mac OS X + Felix OSGI Reporter: Morten Christensen The new JRuby jsr223 support in JRuby 1.5 is hostile to OSGI because it uses the context class loader: Hence, if one try to use javax.script.ScriptEngineManager from a OSGI bundle one will get "ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider org.jruby.embed.jsr223.JRubyEngineFactory could not be instantiated: java.lang.NullPointerException". This error is not so detailed but if one instantiate org.jruby.embed.jsr223.JRubyEngineFactory instead, one will get java.lang.NullPointerException at java.util.Properties$LineReader.readLine(Properties.java:418) at java.util.Properties.load0(Properties.java:337) at java.util.Properties.load(Properties.java:325) at java.util.PropertyResourceBundle.<init>(PropertyResourceBundle.java:111) at org.jruby.embed.util.PropertyReader.<init>(PropertyReader.java:52) at org.jruby.embed.jsr223.JRubyEngineFactory.<init>(JRubyEngineFactory.java:65) Then, looking at the source for org.jruby.embed.util.PropertyReader, I can see it uses "Thread.currentThread().getContextClassLoader()". This is a NO NO in OSGI and will NOT work in standard OSGI environments. Instead, the JRuby jsr223 support should use the classloader argument passed to javax.script.ScriptEngineManager !! -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email