miércoles, 9 de octubre de 2013

ArrayIndexOutOfBoundsException deploying app in Weblogic 12c

I'm getting the following exception deploying an app in Weblogic 12c:

java.lang.ArrayIndexOutOfBoundsException: 242890
at com.bea.objectweb.asm.ClassReader.(Unknown Source)
at com.bea.objectweb.asm.ClassReader.(Unknown Source)
at weblogic.application.utils.annotation.ClassInfoImpl.(ClassInfoImpl.java:44)
at weblogic.application.utils.annotation.ClassfinderClassInfos.polulateOneClassInfo(ClassfinderClassInfos.java:145)
at weblogic.application.utils.annotation.ClassfinderClassInfos.populateClassInfos(ClassfinderClassInfos.java:137)
Truncated. see log file for complete stacktrace

As indicated in this stackoverflow entry, a good way to diagnose the error is to "add an exception breakpoint on java.lang.ArrayIndexOutOfBoundsException, then trying to examine the context to find out the parameters".

You can do this clicking the exception in the Console view.




Once you press OK, an exception breakpoint should appear in the Breakpoints view of the Debug perspective.


You can then restart the server in debug mode and try the deployment again. Once you do it, the server should stop execution and start debugging when the exception is throwed.


If you click the source attribute of the ClassInfoImpl class present in the stack, you can see the Jar which contains the offending class.


If you click the jarEntry attribute you can know the offending class.


You can check the class is indeed invalid, through a decompiler, for example: