Failed to load ApplicationContext caused by ArrayIndexOutOfBoundsException in ClassReader

Most likely you have lambda expression inside one of your spring beans. Apparently, spring 3 beans can’t initialize if there is a lambda somewhere in their code. In case migration to spring 4 is not an option, try to rewrite your lambda expressions using anonymous classes, like

Function<A,B> lambda = new Function() {
    public B apply(A s) { ... }
}

or move lambda code out of the spring bean. I had the same issue and it helped me, I could still use spring 3 with jre/jdk 8.

Avoids this failure:

 Caused by: java.lang.ArrayIndexOutOfBoundsException: 10348
    at org.springframework.asm.ClassReader.<init>(Unknown Source)

Leave a Comment