JRuby 1.3 Fails to Execute Embedded Ruby code in Java
-----------------------------------------------------

                 Key: JRUBY-3633
                 URL: http://jira.codehaus.org/browse/JRUBY-3633
             Project: JRuby
          Issue Type: Bug
          Components: Java Integration
    Affects Versions: JRuby 1.3RC1
         Environment: Mac OS X 10.5.6, Intel Core Duo Macbook, Java 1.6 
(SoyLatte -- http://landonf.bikemonkey.org/static/soylatte/)
            Reporter: Saad Mahamood



When trying to evaluate Ruby code within Java, the following code fails to 
execute and brings up a java.lang.NoSuchMethodError Exception:

ScriptEngineManager scriptEngineManger = new ScriptEngineManager();
ScriptEngine scriptEngine = scriptEngineManger.getEngineByName("jruby");
scriptEngine.eval("puts 1 + 2");

Results in JRuby 1.3:

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: 
org.jruby.Ruby.runNormally(Lorg/jruby/ast/Node;Z)Lorg/jruby/runtime/builtin/IRubyObject;
at com.sun.script.jruby.JRubyScriptEngine.evalNode(JRubyScriptEngine.java:454)
at com.sun.script.jruby.JRubyScriptEngine.eval(JRubyScriptEngine.java:180)
at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)
at 
uk.ac.abdn.babytalk2.readability.ReadabilityScore.generateReadabilityScores(ReadabilityScore.java:449)

This exception even after setting the correct JAR libraries on the classpath  
(jruby-engine.jar, bsf.jar, and jruby.jar) and the correct VM parameter 
(-Djruby.home="/usr/local/jruby-1.3").

Regressing back to JRuby 1.1.6 fixes the error and the ruby code is 
successfully evaluated by the script engine. 

Link to orginal JRuby user mailing list discussion: 
http://comments.gmane.org/gmane.comp.lang.jruby.user/8213

-- 
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


Reply via email to