I'm trying to contruct a Java object whose contructor takes an array, and I
get the following error message:
irb(main):020:0> OtpErlangTuple.new([mbox.self, OtpErlangAtom.new('hi
there')])
NameError: no constructor with arguments matching [class org.jruby.RubyArray]
on object JavaUtilities
from
/home/tsuraan/.jruby/lib/ruby/site_ruby/1.8/builtin/javasupport/proxy/concrete.rb:18:in
`initialize'
from
/home/tsuraan/.jruby/lib/ruby/site_ruby/1.8/builtin/javasupport/proxy/concrete.rb:6:in
`new'
from
/home/tsuraan/.jruby/lib/ruby/site_ruby/1.8/builtin/javasupport/proxy/concrete.rb:6:in
`new'
from (irb):1:in `binding'
So, how can I make this work? I tried the obvious to_java method that
exists on Ruby arrays, but that just slightly changes the error to:
irb(main):030:0> OtpErlangTuple.new([mbox.self, OtpErlangAtom.new('hi
there')].to_ary)
NameError: no constructor with arguments matching [class org.jruby.RubyArray]
on object JavaUtilities
from
/home/tsuraan/.jruby/lib/ruby/site_ruby/1.8/builtin/javasupport/proxy/concrete.rb:23:in
`initialize'
from
/home/tsuraan/.jruby/lib/ruby/site_ruby/1.8/builtin/javasupport/proxy/concrete.rb:6:in
`new'
from
/home/tsuraan/.jruby/lib/ruby/site_ruby/1.8/builtin/javasupport/proxy/concrete.rb:6:in
`new'
from (irb):1:in `binding'
Just to make sure the problem is in the constructor call, doing this works:
irb(main):029:0> [mbox.self, OtpErlangAtom.new('hi there')].to_java
=> #<#<Class:01x4de3fe>:0x1412b61 @java_object=[Ljava.lang.Object;@187275d>
I did an svn update about fifteen minutes ago, and I'm using Sun Java 1.5 on
Linux.