Forum: JRuby jruby error from ManyVarsDynamicScope.java:71

Posted by Jan Hegewald (Guest)
on 2010-08-27 15:27
Attachment: jrubyerror.zip (1,55 KB)
(Received via mailing list)
Dear all,
I stumbled over a nasty error when using jruby. Luckily I could 
reproduce it with a minimal example.
Posted by Yoko Harada (Guest)
on 2010-08-29 03:32
(Received via mailing list)
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 Hegewald <hegewald@irmb.tu-bs.de> 
wrote:
> - compile
>        from RootNode.java:129:in `interpret'
> -- Jan
>
---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email
Posted by Jan Hegewald (Guest)
on 2010-08-30 10:17
(Received via mailing list)
Hi Yoko,

On 29.08.2010, at 03:32, Yoko Harada 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
Posted by Nick Sieger (Guest)
on 2010-08-30 18:19
(Received via mailing list)
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 Hegewald <hegewald@irmb.tu-bs.de> 
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
Posted by Jan Hegewald (Guest)
on 2010-09-01 10:42
(Received via mailing list)
On 30.08.2010, at 18:19, Nick Sieger 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
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.