java.lang.ClassCastException with become_java!

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:incall’
from CachingCallSite.java:289:in cacheAndCall' from CachingCallSite.java:108:incall’
from TestAgain.rb.rb:19:in __file__' from TestAgain.rb.rb:-1:inload’
from Ruby.java:684:in runScript' from Ruby.java:567:inrunNormally’
from Ruby.java:413:in runFromMain' from Main.java:286:inrun’
from Main.java:128:in run' from Main.java:97:inmain’

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:innewInstance0’
from NativeConstructorAccessorImpl.java:39:in newInstance' from DelegatingConstructorAccessorImpl.java:27:innewInstance’
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