java.lang.ArrayIndexOutOfBoundsException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • I'm getting an exception when starting up my Spring Boot application: {code:java} java.lang.ArrayIndexOutOfBoundsException: 193 at org.springframework.asm.ClassReader.readLabel(ClassReader.java:2185) at org.springframework.asm.ClassReader.readTypeAnnotations(ClassReader.java:1614) ... {code} It seems that when my classes are inspected for annotations, ClassReader (Spring 4.2.5) chokes on one of my classes containing Java-8 type annotations. This is extremely unfortunate, because it means that I can't use Spring annotations in combination with type annotations. I've attached a very small (maven) project that reproduces the problem. All you need to do is run "mvn test". The included unit test attempts to read the problematic class file using org.springframework.asm.ClassReader, and gives the same exception as above. The class that can't be read is {code:java} public class Problem implements Interface<String> { public void serialize(String request) { Map<String, @Nullable Object> values = new HashMap<>(); values.clear(); } } {code} The @Nullable type annotation is from org.eclipse.jdt.annotation 2.0.0. I've included the source code in the attached project. And the interface: {code:java} public interface Interface<T> { void serialize(T request); } {code} Without the interface, the problem doesn't occur. Also the type parameter is essential to reproduce the problem. What is also surprising, is that when the class is not compiled by maven (javac), but by Eclipse, the problem does not occur. It would be great to know if there is a workaround for this problem, e.g. compiler settings that can be included in the pom file.
    via by Tom van den Berge,
  • I'm getting an exception when starting up my Spring Boot application: {code:java} java.lang.ArrayIndexOutOfBoundsException: 193 at org.springframework.asm.ClassReader.readLabel(ClassReader.java:2185) at org.springframework.asm.ClassReader.readTypeAnnotations(ClassReader.java:1614) ... {code} It seems that when my classes are inspected for annotations, ClassReader (Spring 4.2.5) chokes on one of my classes containing Java-8 type annotations. This is extremely unfortunate, because it means that I can't use Spring annotations in combination with type annotations. I've attached a very small (maven) project that reproduces the problem. All you need to do is run "mvn test". The included unit test attempts to read the problematic class file using org.springframework.asm.ClassReader, and gives the same exception as above. The class that can't be read is {code:java} public class Problem implements Interface<String> { public void serialize(String request) { Map<String, @Nullable Object> values = new HashMap<>(); values.clear(); } } {code} The @Nullable type annotation is from org.eclipse.jdt.annotation 2.0.0. I've included the source code in the attached project. And the interface: {code:java} public interface Interface<T> { void serialize(T request); } {code} Without the interface, the problem doesn't occur. Also the type parameter is essential to reproduce the problem. What is also surprising, is that when the class is not compiled by maven (javac), but by Eclipse, the problem does not occur. It would be great to know if there is a workaround for this problem, e.g. compiler settings that can be included in the pom file.
    via by Tom van den Berge,
  • Failed to read candidate component class
    via Stack Overflow by dharam
    ,
    • java.lang.ArrayIndexOutOfBoundsException: 193 at org.springframework.asm.ClassReader.readLabel(ClassReader.java:2185) at org.springframework.asm.ClassReader.readTypeAnnotations(ClassReader.java:1614)

    Users with the same issue

    Unknown visitor1 times, last one,