The example code executed in JRuby 1.5 gives
ConcreteJavaProxy.java:84:in needsCreate': java.lang.ClassCastException: ruby.Muh.Test cannot be cast to org.jruby.java.proxies.JavaProxy from ConcreteJavaProxy.java:133:in
call’
from CachingCallSite.java:289:in cacheAndCall' from CachingCallSite.java:108:in
call’
from TestAgain.rb.rb:19:in __file__' from TestAgain.rb.rb:-1:in
load’
from Ruby.java:684:in runScript' from Ruby.java:567:in
runNormally’
from Ruby.java:413:in runFromMain' from Main.java:286:in
run’
from Main.java:128:in run' from Main.java:97:in
main’
It get no such error in 1.4.
Regards
Roger
BTW: If I remove ‘include Enumerable’ I get:
null:-1:in <init>': java.lang.NoSuchMethodError: org.jdesktop.swingx.JXTable.<init>(Lorg/jruby/Ruby;Lorg/jruby/RubyClass;)V from NativeConstructorAccessorImpl.java:-2:in
newInstance0’
from NativeConstructorAccessorImpl.java:39:in newInstance' from DelegatingConstructorAccessorImpl.java:27:in
newInstance’
from Constructor.java:513:in `newInstance’
Example Code
require ‘java’
require ‘jruby/core_ext’
require
“/Users/roger/Documents//global/input_form/resources/java_libs/swingx-1.6.jar”
include_class “org.jdesktop.swingx.JXTable”
include_class “javax.swing.event.ListSelectionListener”
module Muh
class Test < JXTable
include Enumerable
end
end
Muh::Test.become_java!
x = Muh::Test.new
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email