3
votes

what could possibly be causing this stack of error during compilation?? I am using gwt 2+ with eclipse 3.7

[ERROR] Unexpected internal compiler error `java.lang.ArrayIndexOutOfBoundsException: 986507 at com.google.gwt.dev.asm.ClassReader.readUnsignedShort(ClassReader.java:1850) at com.google.gwt.dev.asm.ClassReader.accept(ClassReader.java:484) at com.google.gwt.dev.asm.ClassReader.accept(ClassReader.java:420) at com.google.gwt.dev.javac.TypeOracleMediator$TypeData.getCollectClassData(TypeOracleMediator.java:147) at com.google.gwt.dev.javac.TypeOracleMediator.addNewTypes(TypeOracleMediator.java:390) at com.google.gwt.dev.javac.TypeOracleMediatorFromSource.addNewUnits(TypeOracleMediatorFromSource.java:52) at com.google.gwt.dev.javac.CompilationState.assimilateUnits(CompilationState.java:164) at com.google.gwt.dev.javac.CompilationState.(CompilationState.java:82) at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:450) at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:370) at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:360) at com.google.gwt.dev.Precompile.precompile(Precompile.java:252) at com.google.gwt.dev.Precompile.precompile(Precompile.java:233) at com.google.gwt.dev.Precompile.precompile(Precompile.java:145) at com.google.gwt.dev.Compiler.run(Compiler.java:232) at com.google.gwt.dev.Compiler.run(Compiler.java:198) at com.google.gwt.dev.Compiler$1.run(Compiler.java:170) at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88) at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82) at com.google.gwt.dev.Compiler.main(Compiler.java:177) Shutting down PersistentUnitCache thread Exception in thread "UnitWriteThread" java.lang.NullPointerException at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:183) at com.google.gwt.dev.javac.CompiledClass.writeObject(CompiledClass.java:163) at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at java.io.ObjectStreamClass.invokeWriteObject(Unknown Source) at java.io.ObjectOutputStream.writeSerialData(Unknown Source) at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source) at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.writeArray(Unknown Source) at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source) at java.io.ObjectOutputStream.writeSerialData(Unknown Source) at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source) at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source) at java.io.ObjectOutputStream.writeSerialData(Unknown Source) at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source) at java.io.ObjectOutputStream.writeObject0(Unknown Source) at java.io.ObjectOutputStream.writeObject(Unknown Source) at com.google.gwt.dev.javac.PersistentUnitCache$UnitWriter.run(PersistentUnitCache.java:226)

4

4 Answers

0
votes

Cant say exactly without your code , see while dubugging where exactly this error is coming from , I guess you have some array and you are trying to access the index from that array which is actually Not there

0
votes

Definitely a compiler error. Looking at the asm code - the array variable out of bounds is: The non standard class to be parsed. This field is intended for Attribute sub classes, and is normally not needed by class generators or adapters.

Do you have any mismatched bin/lib jars or executable? Can you localize the offending code to an anonymous or inner class perhaps?

0
votes

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

0
votes

I've had a very similar issue using eclipse luna + GWT 2.7.0 + Java 1.7 + Maven plugin 3.1.1. I Was trying to compile GWT with super dev-mode, but always got a java.lang.ArrayIndexOutOfBoundsException. I think it happens because the compiler is trying to compile classes that are not supposed to be compiled at all (like test classed) but I'm not sure.

The steps I took to solve this issue:

  1. Clean the target folder
  2. Remove test folders from deployment assembly (right click the project in eclipse -> "Deployment Assembly" -> choose test folders and click "Remove"
  3. Compile using GWT plugin: Select the project in eclipse -> click the "GDT Pulldown" button (with the google plugin installed) -> "GWT Compile Project" -> Choose the module you want to compile and hit "Compile".

The last step actually failed for me so I'm not sure if that's the one that helped or not.

Finally, I compiled again and the error was gone.

I hope someone finds this helpful.