2

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

Jiang Zhu
  • 97
  • 1
  • 8

2 Answers2

2

Try deleting the gwt-unitCache folder and run a gwt-compile again. This fixed it for me.

dkris
  • 1,270
  • 1
  • 11
  • 22
1

Upgrade GIN to 2.0.0 fixed my problem

size of the generated Ginjector.java shrink from 110K+ lines to 23 lines :)

Jiang Zhu
  • 97
  • 1
  • 8