Skip to content

Instantly share code, notes, and snippets.

@yokolet
Created February 18, 2010 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yokolet/307782 to your computer and use it in GitHub Desktop.
Save yokolet/307782 to your computer and use it in GitHub Desktop.
electra:jruby~main yoko$ jirb
irb(main):001:0> require 'java'
=> true
irb(main):002:0> c = org.jruby.embed.ScriptingContainer.new
=> org.jruby.embed.ScriptingContainer@4d28c7
irb(main):003:0> c.run_scriptlet("puts \"Hello\"")
Hello
=> nil
irb(main):004:0> c.run_scriptlet("puts \"Hello\"")
java.lang.ArrayIndexOutOfBoundsException: -1
at org.jruby.runtime.ThreadContext.getCurrentScope(ThreadContext.java:194)
at org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.getManyVarsDynamicScope(EmbedRubyRuntimeAdapterImpl.java:212)
at org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.runParser(EmbedRubyRuntimeAdapterImpl.java:170)
at org.jruby.embed.internal.EmbedRubyRuntimeAdapterImpl.parse(EmbedRubyRuntimeAdapterImpl.java:91)
at org.jruby.embed.ScriptingContainer.parse(ScriptingContainer.java:1100)
at org.jruby.embed.ScriptingContainer.runScriptlet(ScriptingContainer.java:1160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:451)
at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:309)
at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:61)
at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:61)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:309)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.RootNode.interpret(RootNode.java:129)
at org.jruby.evaluator.ASTInterpreter.evalWithBinding(ASTInterpreter.java:98)
at org.jruby.RubyKernel.eval(RubyKernel.java:1030)
at org.jruby.RubyKernel$s_method_0_3$RUBYFRAMEDINVOKER$eval.call(org/jruby/RubyKernel$s_method_0_3$RUBYFRAMEDINVOKER$eval.gen)
at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:160)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:66)
at org.jruby.ast.FCallManyArgsNode.interpret(FCallManyArgsNode.java:60)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:113)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:127)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:147)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:66)
at org.jruby.ast.CallManyArgsNode.interpret(CallManyArgsNode.java:59)
at org.jruby.ast.FCallOneArgNode.interpret(FCallOneArgNode.java:36)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:221)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:188)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:186)
at org.jruby.ast.CallTwoArgNode.interpret(CallTwoArgNode.java:59)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.RescueNode.executeBody(RescueNode.java:225)
at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:147)
at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:294)
at org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:228)
at org.jruby.runtime.Block.yieldSpecific(Block.java:99)
at org.jruby.ast.ZYieldNode.interpret(ZYieldNode.java:25)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96)
at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:201)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:180)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:155)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:172)
at org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
at org.jruby.runtime.InterpretedBlock.yieldSpecific(InterpretedBlock.java:259)
at org.jruby.runtime.Block.yieldSpecific(Block.java:117)
at org.jruby.ast.YieldTwoNode.interpret(YieldTwoNode.java:31)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.IfNode.interpret(IfNode.java:117)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.ast.RescueNode.executeBody(RescueNode.java:225)
at org.jruby.ast.RescueNode.interpretWithJavaExceptions(RescueNode.java:147)
at org.jruby.ast.RescueNode.interpret(RescueNode.java:110)
at org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:346)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:303)
at org.jruby.runtime.Block.yield(Block.java:194)
at org.jruby.RubyKernel.loop_1_9(RubyKernel.java:1236)
at org.jruby.RubyKernel$s_method_0_0$RUBYFRAMEDINVOKER$loop_1_9.call(org/jruby/RubyKernel$s_method_0_0$RUBYFRAMEDINVOKER$loop_1_9.gen)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:299)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:117)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:132)
at org.jruby.ast.FCallNoArgBlockNode.interpret(FCallNoArgBlockNode.java:32)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:346)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:303)
at org.jruby.runtime.Block.yield(Block.java:194)
at org.jruby.RubyContinuation.enter(RubyContinuation.java:105)
at org.jruby.RubyKernel.rbCatch(RubyKernel.java:1078)
at org.jruby.RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$rbCatch.call(org/jruby/RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$rbCatch.gen)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:319)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:157)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:172)
at org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:160)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:164)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:299)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:117)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:122)
at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:139)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:156)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:289)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:108)
at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:346)
at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:303)
at org.jruby.runtime.Block.yield(Block.java:194)
at org.jruby.RubyContinuation.enter(RubyContinuation.java:105)
at org.jruby.RubyKernel.rbCatch(RubyKernel.java:1078)
at org.jruby.RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$rbCatch.call(org/jruby/RubyKernel$s_method_1_0$RUBYFRAMEDINVOKER$rbCatch.gen)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:319)
at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:157)
at org.jruby.runtime.callsite.CachingCallSite.callIter(CachingCallSite.java:172)
at org.jruby.ast.FCallOneArgBlockNode.interpret(FCallOneArgBlockNode.java:34)
at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104)
at org.jruby.ast.BlockNode.interpret(BlockNode.java:71)
at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:180)
at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:172)
at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:309)
at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:148)
at Users.yoko.DevSpace.jruby_7e_main.bin.jirb.__file__(jirb:19)
at Users.yoko.DevSpace.jruby_7e_main.bin.jirb.load(jirb)
at org.jruby.Ruby.runScript(Ruby.java:647)
at org.jruby.Ruby.runNormally(Ruby.java:565)
at org.jruby.Ruby.runFromMain(Ruby.java:411)
at org.jruby.Main.run(Main.java:275)
at org.jruby.Main.run(Main.java:117)
at org.jruby.Main.main(Main.java:97)
NativeException: org.jruby.embed.ParseFailedException: java.lang.ArrayIndexOutOfBoundsException: -1
from org/jruby/embed/internal/EmbedRubyRuntimeAdapterImpl.java:197:in `runParser'
from org/jruby/embed/internal/EmbedRubyRuntimeAdapterImpl.java:91:in `parse'
from org/jruby/embed/ScriptingContainer.java:1100:in `parse'
from org/jruby/embed/ScriptingContainer.java:1160:in `runScriptlet'
from :1
irb(main):005:0>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment