GWT 2.8.0 RC1 - InternalCompilerException: Error constructing Java AST

1,629 views
Skip to first unread message

Uwe Maurer

unread,
Aug 2, 2016, 10:07:43 AM8/2/16
to GWT Users
Hi,

I tried GWT 2.8.0 RC1 and get this error. Any ideas?

   Compiling...
[ERROR] An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Error constructing Java AST
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.translateException(GwtAstBuilder.java:3886)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.getInternalCompilerException(GwtAstBuilder.java:4291)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMembers(GwtAstBuilder.java:3985)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.processImpl(GwtAstBuilder.java:3825)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.process(GwtAstBuilder.java:3860)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater$UnitProcessorImpl.process(CompilationStateBuilder.java:129)
at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process(JdtCompiler.java:384)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:470)
at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:1089)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:325)
at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:548)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:479)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:465)
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:423)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:222)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:202)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:143)
at com.google.gwt.dev.Compiler.compile(Compiler.java:204)
at com.google.gwt.dev.Compiler.compile(Compiler.java:155)
at com.google.gwt.dev.Compiler.compile(Compiler.java:144)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
at com.google.gwt.dev.Compiler.main(Compiler.java:125)
Caused by: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.lookup.MethodBinding.isDefaultMethod()Z
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMethod(GwtAstBuilder.java:4080)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.createMembers(GwtAstBuilder.java:3975)
... 21 more
   [ERROR] at DateTimeFormatInfoImpl_es_CL.java(22): public class DateTimeFormatInfoImpl_es_CL extends DateTimeFormatInfoImpl_es_419
      org.eclipse.jdt.internal.compiler.ast.TypeDeclaration


Jens

unread,
Aug 2, 2016, 10:35:37 AM8/2/16
to GWT Users
Caused by: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.lookup.MethodBinding.isDefaultMethod()Z


Check your dependencies. Looks like you have an old JDT on class path and GWT requires a newer one.

-- J.

Uwe Maurer

unread,
Aug 2, 2016, 11:50:22 AM8/2/16
to GWT Users
Thanks for the hint. Yes, the problem was that GWT SDK duplicates these JDT classes instead of depending on the corresponding library.
Then gradle could not resolve this version conflict and kept the old JDT. Forcing a higher version fixed it.

Thomas Broyer

unread,
Aug 2, 2016, 12:03:37 PM8/2/16
to GWT Users


On Tuesday, August 2, 2016 at 5:50:22 PM UTC+2, Uwe Maurer wrote:
Thanks for the hint. Yes, the problem was that GWT SDK duplicates these JDT classes instead of depending on the corresponding library.

JDT is the only dependency that's still bundled into GWT, and this is the case because a) it uses a patched JDT (for a memory issue) and b) it uses internal APIs that are "normally" hidden into a JAR (yes, a JAR inside a JAR) and aren't available in any artifact in any Maven repo (that I know of).

Note: GWT has always bundled its dependencies. It's only starting with 2.8.0-rc1 that dependencies are "referenced" instead; except for JDT.

BTW, what's the reason you have JDT and gwt-dev in the same classpath/scope/configuration? Are you using JDT in client-side code? (a GWT generator?) If not, Gradle is flexible enough so you can correctly segregate dependencies depending on their use.

Uwe Maurer

unread,
Aug 2, 2016, 12:35:05 PM8/2/16
to GWT Users
Great that most dependencies are referenced now.

You are right, the extra JDT library should not even be on the GWT classpath.  
We use the gwt-gradle-plugin to compile GWT projects with gradle, maybe our configuration is not correct there.

Thomas Broyer

unread,
Aug 2, 2016, 5:22:08 PM8/2/16
to GWT Users


On Tuesday, August 2, 2016 at 6:35:05 PM UTC+2, Uwe Maurer wrote:
Great that most dependencies are referenced now.

You are right, the extra JDT library should not even be on the GWT classpath.  
We use the gwt-gradle-plugin to compile GWT projects with gradle, maybe our configuration is not correct there.

I don't know gwt-gradle-plugin well, but quickly looking at its source, I don't think you can do that (without splitting the 'war' and 'gwt' into separate subprojects)
Maybe if you use something like:

configurations.gwt.exclude group: 'xxx.xxx.xxx', module: 'jdt'

or possibly using module replacement to tell Gradle that JDT is "replaced" by gwt-dev whenever both are in the same configuration:

dependencies {
    modules {
        module("xxx.xxx.xxx:jdt") {
            replacedBy("com.google.gwt:gwt-dev")
        }
    }
}

But because gwt-gradle-plugin doesn't use Configuration#extendsFrom, I'm not sure it'll work.

Michael Wiles

unread,
Aug 10, 2016, 11:19:25 AM8/10/16
to GWT Users
I get the same issue using the maven plugin 2.8.0-rc1... Anyone got the maven gwt plugin working? Or is it because I have some rogue dependency?

harshyadav

unread,
Aug 10, 2016, 4:03:25 PM8/10/16
to GWT Users
Try adding just the following dependency:

<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>

Also this, if you have not already done so:

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
<scope>provided</scope>
</dependency>


And this is how GWT dependencies look for me (2.8.0-rc1):

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt</artifactId>
<version>${gwtVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<scope>provided</scope>
</dependency>
<dependencies>

Thomas Broyer

unread,
Aug 12, 2016, 9:15:16 AM8/12/16
to GWT Users
Do you have JDT in your dependencies? (mvn dependency:tree) And do you (still) have both client and server code in the same project? Also, which gwt-maven-plugin do you use, and which version?

Thomas Broyer

unread,
Aug 12, 2016, 9:15:19 AM8/12/16
to GWT Users
Reply all
Reply to author
Forward
0 new messages