GWT dev mode throws ArrayIndexOutOfBoundsException when compile GinjectorImpl.java
- by Jiang Zhu
I'm getting following exception when open my GWT app in development mode. the exact same code can compile successfully using mvn gwt:compile
Caused by: java.lang.ArrayIndexOutOfBoundsException: 3667 at
com.google.gwt.dev.asm.ClassReader.readClass(ClassReader.java:1976)
at com.google.gwt.dev.asm.ClassReader.accept(ClassReader.java:464)
at com.google.gwt.dev.asm.ClassReader.accept(ClassReader.java:420)
at
com.google.gwt.dev.shell.rewrite.HasAnnotation.hasAnnotation(HasAnnotation.java:45)
at
com.google.gwt.dev.shell.CompilingClassLoader.findClass(CompilingClassLoader.java:1100)
at
com.google.gwt.dev.shell.CompilingClassLoader.loadClass(CompilingClassLoader.java:1203)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247) at
java.lang.Class.forName0(Native Method) at
java.lang.Class.forName(Class.java:247) at
com.google.gwt.dev.shell.ModuleSpace.loadClassFromSourceName(ModuleSpace.java:665)
at
com.google.gwt.dev.shell.ModuleSpace.rebindAndCreate(ModuleSpace.java:468)
at
com.google.gwt.dev.shell.GWTBridgeImpl.create(GWTBridgeImpl.java:49)
at com.google.gwt.core.shared.GWT.create(GWT.java:57) at
com.google.gwt.core.client.GWT.create(GWT.java:85) at ...
I overdid ModuleSpace.java and printed out the class name at line 665 before Class.forName() which points out it is trying to load the generated GinjectorImpl.java
I found out my generated GinjectorImpl.java is about 9MB and with 100K+ lines of code.
When I randomly remove some modules from my GWT app it works again, so I'm guessing it is too large for ASM to compile.
Any suggestions? Thanks
Environment:
GWT 2.5.0, GIN 1.5.0, gwt-maven-plugin 2.5.0, Java 6 SE