Jersey REST Exception java.lang.ArrayIndexOutOfBoundsException at org.objectweb.asm.ClassReader.readInt

I am using Jersey 1.2 for building RESTful services using JDK1.5

When I test REST services, I am getting the following exception.

java.lang.ArrayIndexOutOfBoundsException: 2884779 at org.objectweb.asm.ClassReader.readInt(Unknown Source) at org.objectweb.asm.ClassReader.accept(Unknown Source) at org.objectweb.asm.ClassReader.accept(Unknown Source) at com.sun.jersey.spi.scanning.AnnotationScannerListener.onProcess ( at com.sun.jersey.core.spi.scanning.uri.FileSchemeScanner$1. f( at com.sun.jersey.core.util.Closing.f(

I have created a simple class for testing

public class TestRest {

    @Produces( { MediaType.TEXT_HTML })
    public String getClichedMessage() {

        return "Hello Smith";

How can I resolve this issue?

My jar versions



check your annotation

  @Produces(MediaType.TEXT_HTML) also try

Also try

you are having an incorrect version of asm.jar on your classpath. Make sure:

your deployed lib folder contains the same jars as target/app.war/WEB-INF/lib

you don’t have two versions of the asm.jar

you don’t have conflicting versions in maven

Leave a Reply

Your email address will not be published. Required fields are marked *