ClassFormatError: Duplicate interface name in class file' Jruby-1.1.5/Rails

I was just trying to upgrade my Rails app to Jruby-1.1.5 from 1.1.2.
I get the following error below. I poked around a bit and I think its
related to class reloading in development mode.

I threw in a debug statement in
org.jruby.java.MiniJava.createOldStyleImplClass to see what interface
is duplicate:

createOldStyleImplClass org.jruby.gen.InterfaceImpl46879705 superTypes
[org/aps/eop/hibernate/springtx/TxCallback, org/aps/eop/hibernate/
springtx/TxCallback]

The ruby class implementing that interface is:

 class CallbackWrapper #:nodoc: all
    include Java::org.aps.eop.hibernate.springtx.TxCallback

    def block=(block)
      @block = block
    end

    def execute(tx)
      @block.call
    end
  end

I tried setting config.cache_classes = true and it disappears.

Shall I file a bug?
-lenny

NativeException (java.lang.ClassFormatError: Duplicate interface name
in class file org/jruby/gen/InterfaceImpl46879705):
java/lang/ClassLoader.java:-2:in defineClass1' java/lang/ClassLoader.java:675:indefineClass’
org/jruby/util/JRubyClassLoader.java:22:in defineClass' org/jruby/java/MiniJava.java:550:indefineOldStyleImplClass’
org/jruby/java/MiniJava.java:196:in createOldStyleImplClass' org/jruby/javasupport/Java.java:1559:innew_proxy_instance2’
org/jruby/java/proxies/JavaInterfaceTemplate.java:251:in
jcreateProxy' org/jruby/java/proxies/JavaInterfaceTemplate.java:23:inaccess
$000’
org/jruby/java/proxies/JavaInterfaceTemplate.java:158:in call' org/jruby/internal/runtime/methods/JavaMethod.java:62:incall’
org/jruby/RubyClass.java:353:in finvoke' org/jruby/javasupport/util/RuntimeHelpers.java:298:ininvoke’
org/jruby/java/proxies/JavaInterfaceTemplate.java:142:in call' org/jruby/internal/runtime/methods/DynamicMethod.java:226:incall’
org/jruby/internal/runtime/methods/DynamicMethod.java:203:in call' org/jruby/runtime/callsite/CachingCallSite.java:260:incacheAndCall’
org/jruby/runtime/callsite/CachingCallSite.java:75:in call' org/jruby/ast/CallNoArgNode.java:61:ininterpret’
org/jruby/ast/LocalAsgnNode.java:120:in interpret' org/jruby/ast/NewlineNode.java:101:ininterpret’
org/jruby/ast/BlockNode.java:68:in interpret' org/jruby/internal/runtime/methods/DefaultMethod.java:165:ininterpretedCall’
org/jruby/internal/runtime/methods/DefaultMethod.java:142:in `call’


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Lenny M. wrote:

I was just trying to upgrade my Rails app to Jruby-1.1.5 from 1.1.2. I
get the following error below. I poked around a bit and I think its
related to class reloading in development mode.

Shall I file a bug?

Check that it’s still a problem on trunk, and then yes, go ahead and
file a bug.

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

I’m happy to report this does not happen with jruby-1.1.6RC1

-lenny

On Dec 3, 2008, at 1:10 PM, Charles Oliver N. wrote:

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email