You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with a popular (in the payments business) java library called jPOS (from the jPOS.org folks). Jpos.jar to be specific.
I'm unable to get a fully functional object when attempting to use one of the overloaded constructors on the ISOBinaryField class. Seems it will create the object but with none of the methods attached? For example, the class has a public 'toString' method that cannot be accessed? Here is my jirb for the details:
?> >> jpos_ibf.java_class
=> class org.jpos.iso.ISOBinaryField
?> >> jpos_ibf.class
=> Java::JavaObject
?> ?> >> jpos_ibf.toString()
NoMethodError: undefined method toString' for #<Java::JavaObject:0x7ba52267> from (irb):45:inevaluate'
from org/jruby/RubyKernel.java:1101:in eval' from org/jruby/RubyKernel.java:1501:inloop'
from org/jruby/RubyKernel.java:1264:in catch' from org/jruby/RubyKernel.java:1264:incatch'
from /Users/dbirch/jruby/versions/jruby-1.7.16/bin/jirb:13:in (root)' from org/jruby/RubyKernel.java:1081:inload'
from -e:1:in `(root)'
The text was updated successfully, but these errors were encountered:
still an issue on 9K ... probably should get rid of those wrappers once and for good - maybe in 9.2 !?
public org.jpos.iso.ISOBinaryField(int,byte[],int,int)
org.jpos.iso.ISOBinaryField
NoMethodError: undefined method `toString' for #<Java::JavaObject:0x704921a5>
<main> at pos.rb:19
This is now very old, and with no follow-up from the author I'm going to close it.
The JavaClass, JavaObject etc API has been unofficially deprecated for some time, so I would encourage @dlbirch to work with us to figure out the blessed way to do what he needs here, if it doesn't "just work" due to JI fixes we've made over the years.
As for getting rid of those wrappers...we get closer all the time, but there's lots of unusual functionality that's hard to provide on the "real" java.lang.Class and friends. It will happen slowly.
I'm working with a popular (in the payments business) java library called jPOS (from the jPOS.org folks). Jpos.jar to be specific.
I'm unable to get a fully functional object when attempting to use one of the overloaded constructors on the ISOBinaryField class. Seems it will create the object but with none of the methods attached? For example, the class has a public 'toString' method that cannot be accessed? Here is my jirb for the details:
/Users/dbirch/jruby/versions/jruby-1.7.16/bin/jruby --2.0 -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/dbirch/jruby/versions/jruby-1.7.16/bin/jirb --prompt simple
Switch to inspect mode.
?> >> require 'java'
=> false
?> >> require './lib/jpos.jar'
=> true
?> >> java_import org.jpos.iso.ISOBinaryField
=> [Java::OrgJposIso::ISOBinaryField]
?> >> construct = org.jpos.iso.ISOBinaryField.java_class.constructor(Java::int, Java::byte[], Java::int, Java::int)
=> Java::JavaConstructorint,[B,int,int)>
?> >> byte_array = [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
=> [20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
?> >> jpos_ibf = construct.new_instance(2, byte_array, 0, 10)
=> #Java::JavaObject:0x7ba52267
?> >> jpos_ibf.java_class
=> class org.jpos.iso.ISOBinaryField
?> ?> >> jpos_ibf.toString()
NoMethodError: undefined method
toString' for #<Java::JavaObject:0x7ba52267> from (irb):45:in
evaluate'from org/jruby/RubyKernel.java:1101:in
eval' from org/jruby/RubyKernel.java:1501:in
loop'from org/jruby/RubyKernel.java:1264:in
catch' from org/jruby/RubyKernel.java:1264:in
catch'from /Users/dbirch/jruby/versions/jruby-1.7.16/bin/jirb:13:in
(root)' from org/jruby/RubyKernel.java:1081:in
load'from -e:1:in `(root)'
The text was updated successfully, but these errors were encountered: