JRuby and eclipse plugin

Discussion in 'Ruby' started by Ahmed Abdelsalam, Apr 24, 2009.

  1. Hi,...

    I have a problem with running a ruby script from inside eclipse plugin.
    Simply, I created a ruby a script that calls some java functions from
    class inside eclipse plugin. the problem is that the script cannot load
    such java plugin, it gives me the following error:

    Here is the ruby code:
    class Cells < Java::cz.cesnet.meta.jruby.Cells
    def initialize
    @cells = {'a1' => 'Hello a1'};
    end
    end

    The error:
    javax.script.ScriptException: org.jruby.exceptions.RaiseException:
    cannot load Java class cz.cesnet.meta.jruby.Cells
    at
    com.sun.script.jruby.JRubyScriptEngine.evalNode(JRubyScriptEngine.java:456)
    at
    com.sun.script.jruby.JRubyScriptEngine.eval(JRubyScriptEngine.java:186)
    at javax.script.AbstractScriptEngine.eval(Unknown Source)
    ......

    at org.eclipse.equinox.launcher.Main.main(Main.java:1148)
    Caused by: org.jruby.exceptions.RaiseException: cannot load Java class
    cz.cesnet.meta.jruby.Cells
    at (unknown).(unknown)(/builtin/java/ast.rb:49)
    at
    (unknown).get_proxy_or_package_under_package(/builtin/javasupport/java.rb:51)
    at #<Class:01x661532>.method_missing(<unknown>:1)
    at (unknown).(unknown):)1)

    The strange point is that when removing <
    Java::cz.cesnet.meta.jruby.Cells from the above code, the eclipse plugin
    gives no errors, I can even add the command
    Java::JavaLang::System.out.println("wwwww") and it works. Which means it
    can see standard java classes not classes in my eclipse plugin project.

    I'm using JRuby 1.2, eclipse 3.3.2

    Can anyone help me?

    Thanks


    Ahmed
    --
    Posted via http://www.ruby-forum.com/.
     
    Ahmed Abdelsalam, Apr 24, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page