Login  Register

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

Posted by agavazuk on Jul 28, 2015; 3:07pm
URL: https://discuss.asciidoctor.org/java-lang-IncompatibleClassChangeError-Found-interface-org-objectweb-asm-FieldVisitor-but-class-was-d-tp3573.html

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?