Jruby error from ManyVarsDynamicScope.java:71

Dear all,
I stumbled over a nasty error when using jruby. Luckily I could
reproduce it with a minimal example.

Hi Jan,

I’m not sure what you want to do, but I think you should use embedding
API directory from Ruby code.
Your Java code doesn’t return any strings to Ruby. Perhaps, that’s why
you got ArrayIndexOutOfBoundsException since your Ruby code tries to
get the return value as an array.

If you want to get started ScriptingContainer from Ruby, below would
be a better way:

$ jruby --1.9 -S irb
irb(main):001:0> require ‘java’
=> true
irb(main):002:0> c = org.jruby.embed.ScriptingContainer.new
=> #Java::OrgJrubyEmbed::ScriptingContainer:0xf5d030
irb(main):003:0> c.get_compat_version.to_s
=> “RUBY1_9”
irb(main):004:0> c.run_scriptlet(“puts JRUBY_VERSION”)
1.5.2
=> nil

Hope this helps,
-Yoko

On Fri, Aug 27, 2010 at 9:27 AM, Jan H. [email protected]
wrote:

  • compile
    from RootNode.java:129:in `interpret’
    – Jan

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Yoko,

On 29.08.2010, at 03:32, Yoko H. wrote:

Hi Jan,

I’m not sure what you want to do,

as I wrote, I want to report what I consider a bug in jruby. To do this,
I created a minimal example to be able to reproduce the error. Apart
from showing the error, the code snippet has no other purpose. The
application where I first encountered the error of course has a purpose
(-:

but I think you should use embedding
API directory from Ruby code.
Your Java code doesn’t return any strings to Ruby.

Of course it does not return anything, as any void method.

Perhaps, that’s why
you got ArrayIndexOutOfBoundsException since your Ruby code tries to
get the return value as an array.

Sorry, I do not get you here. The ruby code does not assume anything
about the return value.

If you want to get started ScriptingContainer from Ruby

Sorry, but that is not my point.

Best,
– Jan

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

On 30.08.2010, at 18:19, Nick S. wrote:

Does the error happen in 1.8 mode?

No, in 1.8 mode I get the expected output:

$ jruby -w jrubyerror.rb
1.5.2
nil

Please file the code attached to a
bug at http://bugs.jruby.org/ if you think it’s a bug.

yep. done
http://jira.codehaus.org/browse/JRUBY-5057

At a minimum we
may be able to improve the error that’s generated.

That would be something. There so much in ruby 1.9 which I can/will not
miss anymore, thus I always use jruby with --1.9.
Many TIA,
– Jan

Does the error happen in 1.8 mode? Please file the code attached to a
bug at http://bugs.jruby.org/ if you think it’s a bug. At a minimum we
may be able to improve the error that’s generated.

Thanks,
/Nick

On Mon, Aug 30, 2010 at 3:17 AM, Jan H. [email protected]
wrote:

but I think you should use embedding

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs