RedBridge Embedding tutorials - Encountering NullPointerException in StaticScope

  1 post   Feedicon  
Replies: 0 - Last Post: August 17, 2010 21:20
by: Tim Coffman
« Older Topic » Newer Topic
showing 1 - 1 of 1
 
Posted: August 17, 2010 21:20 by Tim Coffman
Following the RedBridge tutorials on embedding JRuby, I have created a scripting container
s_scriptingContainer = new org.jruby.embed.ScriptingContainer (
  org.jruby.embed.LocalContextScope.THREADSAFE,
  org.jruby.embed.LocalVariableBehavior.TRANSIENT
) ;

Then I parsed some code
evalUnit = s_scriptingContainer.parse( "def myfunc\n  puts \"myfunc!\";  end; myfunc()" ) ;

Finally, I tried to run the code:
evalUnit.run()

But I get a NullPointerException at StaticScope.determineModule() line 348 because getEnclosingScope() returns null.
I definitely don't understand why this might be, so if you have any advice I welcome it.
Replies: 0 - Last Post: August 17, 2010 21:20
by: Tim Coffman
« Older Topic » Newer Topic
  • Mysql
  • Glassfish
  • Jruby
  • Rails
  • Nblogo
Terms of Use; Privacy Policy;
© 2010, Oracle Corporation and/or its affiliates
(revision 20120518.3c65429)
 
 
Close
loading
Please Confirm
Close