Login  Register

Re: java.lang.IncompatibleClassChangeError Found interface org.objectweb.asm.FieldVisitor, but class was expected

Posted by mojavelinux on Jul 28, 2015; 5:36pm
URL: https://discuss.asciidoctor.org/java-lang-IncompatibleClassChangeError-Found-interface-org-objectweb-asm-FieldVisitor-but-class-was-d-tp3573p3574.html

I believe there's a known classpath issue between JRuby 1.7 and asm. I've heard from other users that the solution is to move to JRuby 9000 (recently released). JRuby 9000 is much more intelligent about classpath handling.

Cheers,

-Dan

On Tue, Jul 28, 2015 at 9:07 AM, agavazuk [via Asciidoctor :: Discussion] <[hidden email]> wrote:
hi dear community,

got stuck with a problem, when I create a new instance of Asciidoctor, I'm getting this nice exception:

Exception in thread "main" java.lang.IncompatibleClassChangeError: Found interface org.objectweb.asm.FieldVisitor, but class was expected
        at org.jruby.java.codegen.RealClassGenerator.defineOldStyleImplClass(RealClassGenerator.java:104)
        at org.jruby.java.codegen.RealClassGenerator.createOldStyleImplClass(RealClassGenerator.java:63)
        at org.jruby.javasupport.Java.newInterfaceImpl(Java.java:1183)
        at org.jruby.java.proxies.JavaInterfaceTemplate.jcreateProxy(JavaInterfaceTemplate.java:281)
        at org.jruby.java.proxies.JavaInterfaceTemplate.access$000(JavaInterfaceTemplate.java:30)
        at org.jruby.java.proxies.JavaInterfaceTemplate$4.call(JavaInterfaceTemplate.java:181)
        at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodN.call(JavaMethod.java:661)
        at org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:198)
        at org.jruby.RubyClass.finvoke(RubyClass.java:624)
        at org.jruby.runtime.Helpers.invoke(Helpers.java:500)
        at org.jruby.javasupport.JavaUtil.convertProcToInterface(JavaUtil.java:248)
        at org.jruby.RubyBasicObject.toJava(RubyBasicObject.java:800)
        at org.jruby.javasupport.JavaEmbedUtils.rubyToJava(JavaEmbedUtils.java:273)
        at org.asciidoctor.internal.RubyUtils.rubyToJava(RubyUtils.java:18)
        at org.asciidoctor.internal.JRubyAsciidoctorModuleFactory.createAsciidoctorModule(JRubyAsciidoctorModuleFactory.java:27)
        at org.asciidoctor.internal.JRubyAsciidoctor.createJRubyAsciidoctorInstance(JRubyAsciidoctor.java:123)
        at org.asciidoctor.internal.JRubyAsciidoctor.create(JRubyAsciidoctor.java:62)
        at org.asciidoctor.Asciidoctor$Factory.create(Asciidoctor.java:647)


Quick check shows that jruby-complete-1.7.16.1.jar!/org/objectweb/asm/FieldVisitor.class is an abstract class as the Jruby code expects, however, my classpath contains a reference to asm 3.1 where FieldVisitor is actually interface :)

Has anyone had similar issue before?


To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--