7
votes

I am unable to compile to js in GWT.

devmode runs fine as always. I'd made quite a few changes between compiles so don't know exactly where to look.

What might resolve this?

[gwt 2.5 AE 1.7.1]

[ERROR] Unexpected internal compiler error

java.lang.RuntimeException: Unexpected IOException on in-memory stream at com.google.gwt.dev.javac.CompilationUnit.getTypes(CompilationUnit.java:324) at com.google.gwt.dev.jjs.impl.UnifyAst.assimilateUnit(UnifyAst.java:672) at com.google.gwt.dev.jjs.impl.UnifyAst.searchForTypeBySource(UnifyAst.java:985) at com.google.gwt.dev.jjs.impl.UnifyAst.addRootTypes(UnifyAst.java:530) at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:621) at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:33) at com.google.gwt.dev.Precompile.precompile(Precompile.java:278) at com.google.gwt.dev.Precompile.precompile(Precompile.java:229) at com.google.gwt.dev.Precompile.precompile(Precompile.java:141) 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) Caused by: java.io.InvalidClassException: com.google.gwt.dev.jjs.ast.JDeclaredType; local class incompatible: stream classdesc serialVersionUID = -8155793964565947646, local class serialVersionUID = -1052417216019896795 at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:604) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1514) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at java.util.ArrayList.readObject(ArrayList.java:733) at sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:601) at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1004) at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1872) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1777) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1347) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:369) at com.google.gwt.dev.jjs.ast.JProgram.deserializeTypes(JProgram.java:203) at com.google.gwt.dev.javac.CompilationUnit.getTypes(CompilationUnit.java:322) ... 14 more Shutting down PersistentUnitCache thread

2
Did you try the latest version of both GWT and GAE or is there a reason you are not using the latest releases? - M.Sameer
Yeah - I only notice the problem after upgrading to GWT 2.5.1 so reverted back to see if that would solve it. Anyway, the solution: remove gwt-UnitCache – - user1258245

2 Answers

16
votes

Solution: delete the folder named gwt-unitCache

1
votes

When you see this "local class incompatible: stream classdesc serialVersionUID = -8155793964565947646, local class serialVersionUID = -1052417216019896795" then you probably tried to compile newer GWT version using older GWT compiler. Solution for it when you use Maven is to changed GWT version. For example

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.5.0</version>
<executions>
    <!-- GWT version detected from dependencyManagement -->
    <execution>
        <goals>
            <goal>compile</goal>
        </goals>
    </execution>
</executions>

Change <version>2.5.0</version> to <version>2.5.1</version>, it works for me.