Can't compile widgetset

Hi Vaadin friends,

I freshly installed eclipse latest version with jdk1.8 and I can’t compile widgetset for my vaadin8 maven project.
The same project compiles correctly with ivy.

This is the output of mvn install:


[INFO]
 --- maven-resources-plugin:2.6:resources (default-resources) @ app ---
[INFO]
 Using 'UTF-8' encoding to copy filtered resources.
[INFO]
 Copying 5 resources
[INFO]
 Copying 1 resource
[INFO]

[INFO]
 --- maven-compiler-plugin:3.1:compile (default-compile) @ app ---
[INFO]
 Nothing to compile - all classes are up to date
[INFO]

[INFO]
 --- vaadin-maven-plugin:8.5.2:compile (default) @ app ---
[INFO]
 auto discovered modules [AppWidgetset]

[INFO]
 Using com.vaadin:vaadin-client version 8.5.2
[INFO]
 Using com.vaadin:vaadin-client-compiler version 8.5.2
[INFO]
 Compiling module AppWidgetset
[INFO]
 [ERROR]
 An internal compiler exception occurred
[INFO]
 com.google.gwt.dev.jjs.InternalCompilerException: Error constructing Java AST
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder.translateException(GwtAstBuilder.java:3997)
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.endVisit(GwtAstBuilder.java:1569)
[INFO]
  at org.eclipse.jdt.internal.compiler.ast.MessageSend.traverse(MessageSend.java:1021)
[INFO]
  at org.eclipse.jdt.internal.compiler.ast.ReturnStatement.traverse(ReturnStatement.java:373)
[INFO]
  at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:347)
[INFO]
  at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1490)
[INFO]
  at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1363)
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder.processImpl(GwtAstBuilder.java:3933)
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder.process(GwtAstBuilder.java:3971)
[INFO]
  at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater$UnitProcessorImpl.process(CompilationStateBuilder.java:129)
[INFO]
  at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process(JdtCompiler.java:336)
[INFO]
  at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:470)
[INFO]
  at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:1040)
[INFO]
  at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:325)
[INFO]
  at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:548)
[INFO]
  at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:479)
[INFO]
  at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:465)
[INFO]
  at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:423)
[INFO]
  at com.google.gwt.dev.Precompile.precompile(Precompile.java:222)
[INFO]
  at com.google.gwt.dev.Precompile.precompile(Precompile.java:202)
[INFO]
  at com.google.gwt.dev.Precompile.precompile(Precompile.java:143)
[INFO]
  at com.google.gwt.dev.Compiler.compile(Compiler.java:204)
[INFO]
  at com.google.gwt.dev.Compiler.compile(Compiler.java:155)
[INFO]
  at com.google.gwt.dev.Compiler.compile(Compiler.java:144)
[INFO]
  at com.google.gwt.dev.Compiler$1.run(Compiler.java:118)
[INFO]
  at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[INFO]
  at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[INFO]
  at com.google.gwt.dev.Compiler.main(Compiler.java:125)
[INFO]
 Caused by: java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.ast.MessageSend.binding()Lorg/eclipse/jdt/internal/compiler/lookup/MethodBinding;
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder.isUncheckedGenericMethodCall(GwtAstBuilder.java:4220)
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder.access$1400(GwtAstBuilder.java:250)
[INFO]
  at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.endVisit(GwtAstBuilder.java:1562)
[INFO]
  ... 26 more
[INFO]
    [ERROR]
 at WidgetUtil.java(1477): type2Unit.get(type)
[INFO]
       org.eclipse.jdt.internal.compiler.ast.MessageSend
[INFO]
 ------------------------------------------------------------------------
[INFO]
 BUILD FAILURE
[INFO]
 ------------------------------------------------------------------------
[INFO]
 Total time: 21.178 s
[INFO]
 Finished at: 2018-10-01T18:02:29+02:00
[INFO]
 ------------------------------------------------------------------------
[ERROR]
 Failed to execute goal com.vaadin:vaadin-maven-plugin:8.5.2:compile (default) on project app: Command [[
[ERROR]
 C:\Program Files\Java\jdk1.8.0_181\jre\bin\java -Xmx1G -Dgwt.persistentunitcache=false com.google.gwt.dev.Compiler -logLevel INFO -style OBF -war *PATH*\app\target\classes\VAADIN\widgetsets -localWorkers 12 -failOnError -XfragmentCount -1 -sourceLevel auto -gen *PATH*\app\target\.generated AppWidgetset
[ERROR]
 ]] failed with status 1
[ERROR]
 -> [Help 1]

[ERROR]

[ERROR]
 To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR]
 Re-run Maven using the -X switch to enable full debug logging.
[ERROR]

[ERROR]
 For more information about the errors and possible solutions, please read the following articles:
[ERROR]
 [Help 1]
 http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

I can’t help solving this problem. Anyone?

Hi everyone,

I solved the problem.

It was a classpath problem.

With the command mvn depencenty:tree I inspected and found an old version of org.eclipse.jdt.core.compiler.ecj requested by jasperreports 6.7.0

so, adding this to pom.xml solved the problem:


		<dependency>
		    <groupId>org.eclipse.jdt.core.compiler</groupId>
		    <artifactId>ecj</artifactId>
		    <version>4.6.1</version>
		</dependency>
		
		

OMG! God bless you Giacomo!

I would have never found this. Can you tell me how you found this the steps you took?

Thanks,

Faras

P.S. Screen shots would be very helpful.