moshe beeri
moshe beeri

Reputation: 2037

Jersey 2 AnnotatedClassVisitor has interface jersey.repackaged.org.objectweb.asm.ClassVisitor as super class

I keep getting this error when migrating to Jersey 2. At fist I though it is some Maven issue but it does not looks like that. I keep getting: AnnotatedClassVisitor has interface jersey.repackaged.org.objectweb.asm.ClassVisitor as super class

my Maven look like that:

    <dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-client</artifactId>
        <version>2.15</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.core</groupId>
        <artifactId>jersey-common</artifactId>
        <version>2.15</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.media</groupId>
        <artifactId>jersey-media-json-jackson</artifactId>
        <version>2.15</version>
    </dependency>
    <dependency>
        <groupId>org.glassfish.jersey.containers</groupId>
        <artifactId>jersey-container-jdk-http</artifactId>
        <version>2.15</version>
    </dependency>

Any idea will be helpfull

Upvotes: 0

Views: 2016

Answers (1)

Michal Gajdos
Michal Gajdos

Reputation: 10379

You probably have Jersey 1.x Server module on your class-path. This module (before version 1.19) contains repackaged ASM 3 where ClassVisitor is still an interface. Remove the 1.x dependencies from your code and should be fine.

Note: Jersey 2.x Server module also contains repackaged ASM. But the repackaged ASM is newer, version 5, and ClassVisitor there is already an abstract class.

Upvotes: 4

Related Questions