Java Class losing its array attributes

Hi all,

I’m working with JRuby 1.2RC1 where I ran into an issue that I don’t
know
whether it’s JRuby issue or otherwise so please be patient with me as I
explain the issue.

I have a ruby script calls a Java class that was generated by Axis2
which
uses xmlbeans v.2.3. I’m able to instantiate the class fine through it’s
Factory inner class

begin
geocodingInput =
ArrayOfRecognitionBaseInputType::Factory.newInstance()
puts “geocoding input #{geocodingInput.class}”
rescue Exception => e
puts e.backtrace
end

running the above I get the following output: geocoding input
Java::ComDmtispatialServicesTypesRecognitionBaseImpl::ArrayOfRecognitionBaseInputTypeImpl

which is correct however when I try to access the array elements, after
executing some code to populate the instance with data, through a method
on
the class by executing the following call

puts "#{geocodingInput.getRecognitionBaseInputTypeArray()}"

I get the memory location of the object

[Lcom.dmtispatial.services.types.recognition.base.RecognitionBaseInputType;@67f797

P.S. the same code written straight in Java executs fine.

Am I missing something here or there’s this is a bug?

If my question is not clear, please let me know and I’ll send more
details.

Thanks,

-Hany Mesha

P Before printing this e-mail please consider if it’s really necessary.
The
environment belongs to everybody

Hany Mesha wrote:

Hi all,

I’m working with JRuby 1.2RC1 where I ran into an issue that I don’t
know whether it’s JRuby issue or otherwise so please be patient with me
as I explain the issue.

I think we managed to resolve this for you on IRC, right? Can you
explain what the problem was?

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

That’s true Charlie.

The idea to reslove this issue was to use to_a on the Java array
instance to
get back an equivlant Ruby array instance that will then be able to
retrieve
or add elements to it.

Thanks all for your help.

-Hany

On Thu, Mar 12, 2009 at 1:13 PM, Charles Oliver N. <
[email protected]> wrote:

I think we managed to resolve this for you on IRC, right? Can you explain


-Hany Mesha
Telephone : 416-456-6945
email: [email protected]

P Before printing this e-mail please consider if it’s really necessary.
The
environment belongs to everybody