I would guess your problem lies somewhere in here, and that we would need to examine how EclipseShell is calling Ruby form those multiple threads to see what's happening. We may be able to boil it down to a simple test case that fires off multiple external threads and does evalScript calls from each.
On 3/28/06, Werner Schuster (murphee) <[EMAIL PROTECTED]> wrote:
Thomas E Enebo wrote:
>JRuby 0.8.3 has been released. This version fixes a
>huge number of problems and boasts the following notables:
>
>
Thanks for the new release!
But: I tested this with the EclipseShell JRuby support (ie. simply
replaced it's JRuby jar with 0.8.3 from 0.8.2),
and now I keep on getting Exceptions when I evaluate some expressions.
Evaluating "1+1" and assignments seem to work, but anything else causes
various exceptions.
Eg. evaluating
require 'java'
causes:
java.lang.NullPointerException
at
org.jruby.evaluator.EvaluateVisitor$VCallNodeVisitor.execute(EvaluateVisitor.java:1923)
at
org.jruby.evaluator.EvaluationState.executeNext (EvaluationState.java:211)
at org.jruby.evaluator.EvaluationState.begin(EvaluationState.java:291)
at org.jruby.Ruby.eval(Ruby.java:188)
at org.jruby.Ruby.evalScript(Ruby.java:181)
at
org.ruby.eclipse.rubyenvironment.providers.JRubyEnvironment.execute (JRubyEnvironment.java:95)
at
net.sf.eclipseshell.editors.InterpreterEditor$EvaluateJob.run(InterpreterEditor.java:568)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
Evaluating
def foo
"Foo"
end
causes:
java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.get(ArrayList.java:323)
at org.jruby.util.UnsynchronizedStack.peek(UnsynchronizedStack.java :26)
at org.jruby.runtime.ThreadContext.peekCRef(ThreadContext.java:453)
at
org.jruby.evaluator.EvaluateVisitor$DefnNodeVisitor.execute(EvaluateVisitor.java:895)
at
org.jruby.evaluator.EvaluationState.executeNext (EvaluationState.java:211)
at org.jruby.evaluator.EvaluationState.begin(EvaluationState.java:291)
at org.jruby.Ruby.eval(Ruby.java:188)
at org.jruby.Ruby.evalScript(Ruby.java:181)
at
org.ruby.eclipse.rubyenvironment.providers.JRubyEnvironment.execute (JRubyEnvironment.java:95)
at
net.sf.eclipseshell.editors.InterpreterEditor$EvaluateJob.run(InterpreterEditor.java:568)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:76)
I tried debugging this, but I couldn't really figure out what's up; one
place where an NPE happened was in the
EvaluateVisitor, line 1028 (last line of method public void
execute(EvaluationState state, InstructionContext ctx) );
Now... this worked before, so I'm wondering if you changed something in
the way a org.jruby.Ruby instance must be used.
Basically, what I do:
ruby_ = Ruby.getDefaultInstance();
Then reuse this ruby_ field to evaluate Scripts:
obj = ruby_.evalScript(code);
Do I have to set something else up?
Notes:
- I run these evalScript calls from different threads each time, is
that a problem?
- I use Java 5
Thanks,
murphee
--
Blog @ http://jroller.com/page/murphee
Maintainer of EclipseShell @ http://eclipse-shell.sourceforge.net/
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Jruby-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jruby-devel
--
Charles Oliver Nutter @ headius.blogspot.com
JRuby Developer @ jruby.sourceforge.net
Application Architect @ www.ventera.com
