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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

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

agavazuk
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?
Reply | Threaded
Open this post in threaded view
|

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

mojavelinux
Administrator
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



--
Reply | Threaded
Open this post in threaded view
|

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

agavazuk
In reply to this post by agavazuk
Hi again,

another solution to the problem is to find a guilty guy :) - in my case its guice v3.0, I have to migrate to 4.0 where asm interface falls into different package name.


Dan, thank you very much for the idea with new version
Reply | Threaded
Open this post in threaded view
|

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

mojavelinux
Administrator
+1

I'm glad it helped get you over the hump!

Cheers,

-Dan

On Tue, Jul 28, 2015 at 4:22 PM, agavazuk [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi again,

another solution to the problem is to find a guilty guy :) - in my case its guice v3.0, I have to migrate to 4.0 where asm interface falls into different package name.


Dan, thank you very much for the idea with new version



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



--