Strange java.lang.ArrayIndexOutOfBoundsException thrown on jetty startup

For your 2 errors ..

javax.servlet.ServletException: jersey-serlvet

This means you have a typo in your WEB-INF/web.xml

As for this one ..

java.lang.ArrayIndexOutOfBoundsException: 6241
    at org.objectweb.asm.ClassReader.<init>(Unknown Source)

I’ve seen similar ones when using an old version of asm.jar with newer compiled Java bytecode.

  • For Java 15 bytecode, use asm 7.3.1+
  • For Java 14 bytecode, use asm 7.2+
  • For Java 13 bytecode, use asm 7.1+
  • For Java 12 bytecode, use asm 7.1+
  • For Java 11 bytecode, use asm 7.0+
  • For Java 10 bytecode, use asm 6.1+
  • For Java 9 bytecode, use asm 6.0+
  • For Java 8 bytecode, use asm 5.0.1+
  • For Java 6 or Java 7 bytecode, (Use asm 3.1 if you must, but know that asm 5.x is also going to work here too)

Ensure that your asm.jar (or org.objectweb.asm.jar) is current.

There is a slightly less common issue where the class itself is bad. Sometimes seen with classes that are compiled in one JDK (such as IBM) and then run on another Java (like Sun/Oracle).

A real world example of this would be the icu4j-2.6.1.jar and its com/ibm/icu/impl/data/LocaleElements_zh__PINYIN.class jar entry.

Leave a Comment