GWT Compilation Fails using maven but not eclipse - NoSuchMethodError UiBinderWriter.<init>

0 views
Skip to first unread message

Clay H via StackOverflow

unread,
Dec 6, 2014, 9:01:22 PM12/6/14
to google-appengin...@googlegroups.com

I'm running into an exception compiling a GWT project using maven, but it's working in eclipse. I've spend the last few hours googling and searching StackOverflow, but while a couple results were relevant, none fit my situation.

Environment:

  • OSX 10.10.1
  • Java 1.7.0_67 64 bit
  • GWT 2.7.0
  • GWTP 1.3.1
  • GAE 1.9.17
  • Maven 3.2.3

I can run the project in eclipse using Super Dev Mode, and it works fine. I can use the Eclipse GWT plugin to compile the project - it completes successfully. But if I try to compile via the terminal using mvn clean compile gwt:compile, I get the following error:

[INFO] Compiling module com.example.foo.Foo
[INFO]    [ERROR] An internal compiler exception occurred
[INFO] com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
[INFO]  at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:121)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:296)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[INFO]  at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)
[INFO]  at com.google.gwt.dev.jjs.ast.JDeclarationStatement.traverse(JDeclarationStatement.java:49)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:95)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351)
[INFO]  at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[INFO]  at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149)
[INFO]  at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:145)
[INFO]  at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[INFO]  at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:600)
[INFO]  at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:569)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1505)
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:870)
[INFO]  at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1305)
[INFO]  at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.constructJavaAst(JavaToJavaScriptCompiler.java:1038)
[INFO]  at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.precompile(JavaToJavaScriptCompiler.java:954)
[INFO]  at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.precompile(MonolithicJavaToJavaScriptCompiler.java:303)
[INFO]  at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:38)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:286)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
[INFO]  at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:206)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:158)
[INFO]  at com.google.gwt.dev.Compiler$1.run(Compiler.java:120)
[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:127)
[INFO] Caused by: java.lang.NoSuchMethodError: com.google.gwt.uibinder.rebind.UiBinderWriter.<init>(Lcom/google/gwt/core/ext/typeinfo/JClassType;Ljava/lang/String;Ljava/lang/String;Lcom/google/gwt/core/ext/typeinfo/TypeOracle;Lcom/google/gwt/uibinder/rebind/MortalLogger;Lcom/google/gwt/uibinder/rebind/FieldManager;Lcom/google/gwt/uibinder/rebind/messages/MessagesWriter;Lcom/google/gwt/uibinder/rebind/DesignTimeUtils;Lcom/google/gwt/uibinder/rebind/UiBinderContext;ZZLjava/lang/String;)V
[INFO]  at com.google.gwt.uibinder.rebind.UiBinderGenerator.generateOnce(UiBinderGenerator.java:187)
[INFO]  at com.google.gwt.uibinder.rebind.UiBinderGenerator.generate(UiBinderGenerator.java:135)
[INFO]  at com.google.gwt.core.ext.IncrementalGenerator.generateNonIncrementally(IncrementalGenerator.java:40)
[INFO]  at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:760)
[INFO]  at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:160)
[INFO]  at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:79)
[INFO]  at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:276)
[INFO]  at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:265)
[INFO]  at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:87)
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createStaticRebindExpression(UnifyAst.java:485)
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.createRebindExpression(UnifyAst.java:443)
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.handleMagicMethodCall(UnifyAst.java:576)
[INFO]  at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.endVisit(UnifyAst.java:306)
[INFO]  at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:248)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[INFO]  at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[INFO]  ... 35 more
[INFO]       [ERROR] at com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java(91): GWT.create(ApplicationView$Binder.class)
[INFO]          com.google.gwt.dev.jjs.ast.JMethodCall
[INFO]       [ERROR] at com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java(91): Object created = GWT.create(ApplicationView$Binder.class)
[INFO]          com.google.gwt.dev.jjs.ast.JDeclarationStatement
[INFO]       [ERROR] at com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java(90): {
[INFO]   Object created = GWT.create(ApplicationView$Binder.class);
[INFO]   assert created instanceof ApplicationView$Binder;
[INFO]   ApplicationView$Binder result = (ApplicationView$Binder) created;
[INFO]   this.memberInject_Key$type$com$example$foo$client$application$ApplicationView$Binder$_annotation$$none$$(result);
[INFO]   return result;
[INFO] }
[INFO]          com.google.gwt.dev.jjs.ast.JBlock
[INFO]       [ERROR] at com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java(90): {
[INFO]   Object created = GWT.create(ApplicationView$Binder.class);
[INFO]   assert created instanceof ApplicationView$Binder;
[INFO]   ApplicationView$Binder result = (ApplicationView$Binder) created;
[INFO]   this.memberInject_Key$type$com$example$foo$client$application$ApplicationView$Binder$_annotation$$none$$(result);
[INFO]   return result;
[INFO] }
[INFO]          com.google.gwt.dev.jjs.ast.JMethodBody
[INFO]       [ERROR] at com_gwtplatform_mvp_client_DesktopGinjector_DesktopGinjectorGinjector_fragment.java(90): public ApplicationView$Binder get_Key$type$com$example$foo$client$application$ApplicationView$Binder$_annotation$$none$$();
[INFO] 
[INFO]          com.google.gwt.dev.jjs.ast.JMethod
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 14.013 s
[INFO] Finished at: 2014-12-06T20:28:36-05:00
[INFO] Final Memory: 13M/310M
[INFO] ------------------------------------------------------------------------

I used the GWTP plugin to generate a basic project for use on Google App Engine, and had to tweak a number of things to get it so that it would work locally and push to app engine. It compiled fine at the time, eclipse or maven. I made a few more modifications, mostly messing with UI and GWT Logging, testing all the while in Super Dev Mode, and it worked fine. works fine now. Since it wasn't done, I didn't try to upload to GAE.

Research:

One involved inherited modules that were overriding the GWT UIBinder implementation, but I have added no inherits or dependencies from the archetype I used to generate it. Plus, it works through eclipse / SuperDevMode. The other was about getting compilation to work in eclipse, and I may have used it to get eclipse working when I first worked on the project a week ago. But it works in eclipse, but not via maven command line.

I've tried removing various modules not required by gwt/gwtp and have had no luck. I specified a gwt-user and gwt-dev import version, nothing. Always I get that same error, and it's driving me mad! I just can't figure out why it won't compile with 'normal' maven.



Please DO NOT REPLY directly to this email but go to StackOverflow:
http://stackoverflow.com/questions/27338728/gwt-compilation-fails-using-maven-but-not-eclipse-nosuchmethoderror-uibinderwr
Reply all
Reply to author
Forward
0 new messages