My GWT compiler started failing with a NoSuchMethodError. It started happening when I updated a method parameter from an Long to a long. I shouldn't need to but I tried switching it back and I'm still having the same error. My java eclipse runtime compiler doesn't see the line as an error, and everything is running fine in dev mode.
Caused by: java.lang.NoSuchMethodError: com.dscicorp.ribeye.shared.dto.Data.put(Ljava/lang/String;Ljava/lang/Long)Ljava/lang/String;
So it seems like it's treating long's and Long's as different types. Here's what the actual method looks like:
public String put(String key, long value) {
return put(key, Long.toString(value));
}
I'm not sure if this has something to do with it but in the error message it's outputting the line slightly differently than what's in my code. It replaced the long variable "val" with "Long.valueOf(val)".
this.this$01.reportOptions.put("noteTypes", Long.valueOf(val))
I tried adding both long and Long versions to see if it got past this problem, and it did but it errored similarly in another place. Is this a GWT bug or could I have something possibly configured wrong?
Here's the full compiler log:
gwtc:
[java] Compiling module com.dscicorp.ribeye.RibEye
[java] Computing all possible rebind results for 'com.dscicorp.ribeye.client.generated.ReflectiveFactory'
[java] Rebinding com.dscicorp.ribeye.client.generated.ReflectiveFactory
[java] Invoking generator com.dscicorp.ribeye.generator.FactoryGenerator
[java] Generating source for com.dscicorp.ribeye.client.generated.ReflectiveFactory
[java] Rebinding com.dscicorp.ribeye.client.generated.ReflectiveFactory
[java] Invoking generator com.dscicorp.ribeye.generator.FactoryGenerator
[java] Generating source for com.dscicorp.ribeye.client.generated.ReflectiveFactory
[java] Rebinding com.dscicorp.ribeye.client.generated.ReflectiveFactory
[java] Invoking generator com.dscicorp.ribeye.generator.FactoryGenerator
[java] Generating source for com.dscicorp.ribeye.client.generated.ReflectiveFactory
[java] Rebinding com.dscicorp.ribeye.client.generated.ReflectiveFactory
[java] Invoking generator com.dscicorp.ribeye.generator.FactoryGenerator
[java] Generating source for com.dscicorp.ribeye.client.generated.ReflectiveFactory
[java] Rebinding com.dscicorp.ribeye.client.generated.ReflectiveFactory
[java] Invoking generator com.dscicorp.ribeye.generator.FactoryGenerator
[java] Generating source for com.dscicorp.ribeye.client.generated.ReflectiveFactory
[java] [ERROR] An internal compiler exception occurred
[java] com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
[java] at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:121)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:296)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[java] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:128)
[java] at com.google.gwt.dev.jjs.ast.JExpressionStatement.traverse(JExpressionStatement.java:42)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:95)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351)
[java] at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[java] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149)
[java] at com.google.gwt.dev.jjs.ast.JIfStatement.traverse(JIfStatement.java:53)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor$ListContext.traverse(JModVisitor.java:95)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemove(JModVisitor.java:351)
[java] at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[java] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:149)
[java] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:145)
[java] at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[java] at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:600)
[java] at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:569)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:285)
[java] at com.google.gwt.dev.jjs.impl.UnifyAst.mainLoop(UnifyAst.java:1505)
[java] at com.google.gwt.dev.jjs.impl.UnifyAst.exec(UnifyAst.java:870)
[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.unifyJavaAst(JavaToJavaScriptCompiler.java:1305)
[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.constructJavaAst(JavaToJavaScriptCompiler.java:1038)
[java] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$Precompiler.precompile(JavaToJavaScriptCompiler.java:954)
[java] at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.precompile(MonolithicJavaToJavaScriptCompiler.java:303)
[java] at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:38)
[java] at com.google.gwt.dev.Precompile.precompile(Precompile.java:286)
[java] at com.google.gwt.dev.Precompile.precompile(Precompile.java:229)
[java] at com.google.gwt.dev.Precompile.precompile(Precompile.java:145)
[java] at com.google.gwt.dev.Compiler.run(Compiler.java:206)
[java] at com.google.gwt.dev.Compiler.run(Compiler.java:158)
[java] at com.google.gwt.dev.Compiler$1.run(Compiler.java:120)
[java] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:55)
[java] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:50)
[java] at com.google.gwt.dev.Compiler.main(Compiler.java:127)
[java] Caused by: java.lang.NoSuchMethodError: com.dscicorp.ribeye.shared.dto.Data.put(Ljava/lang/String;Ljava/lang/Long;)Ljava/lang/String;
[java] at com.google.gwt.dev.jjs.impl.UnifyAst.translate(UnifyAst.java:1715)
[java] at com.google.gwt.dev.jjs.impl.UnifyAst.access$1100(UnifyAst.java:134)
[java] at com.google.gwt.dev.jjs.impl.UnifyAst$UnifyVisitor.visit(UnifyAst.java:416)
[java] at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:245)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:381)
[java] at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:293)
[java] ... 42 more
[java] [ERROR] at MasterWorkLogSearchReportPage.java(281): this.this$01.reportOptions.put("noteTypes", Long.valueOf(val))
[java] com.google.gwt.dev.jjs.ast.JMethodCall
[java] [ERROR] at MasterWorkLogSearchReportPage.java(281): this.this$01.reportOptions.put("noteTypes", Long.valueOf(val))
[java] com.google.gwt.dev.jjs.ast.JExpressionStatement
[java] [ERROR] at MasterWorkLogSearchReportPage.java(280): {
[java] this.this$01.reportOptions.put("noteTypes", Long.valueOf(val));
[java] }
[java] com.google.gwt.dev.jjs.ast.JBlock
[java] [ERROR] at MasterWorkLogSearchReportPage.java(280): if (val > 0) {
[java] this.this$01.reportOptions.put("noteTypes", Long.valueOf(val));
[java] } else {
[java] this.this$01.reportOptions.remove("noteTypes");
[java] }
[java] com.google.gwt.dev.jjs.ast.JIfStatement
[java] [ERROR] at MasterWorkLogSearchReportPage.java(277): {
[java] long val = this.this$01.getNoteTypesValue();
[java] if (val > 0) {
[java] this.this$01.reportOptions.put("noteTypes", Long.valueOf(val));
[java] } else {
[java] this.this$01.reportOptions.remove("noteTypes");
[java] }
[java] }
[java] com.google.gwt.dev.jjs.ast.JBlock
[java] [ERROR] at MasterWorkLogSearchReportPage.java(277): {
[java] long val = this.this$01.getNoteTypesValue();
[java] if (val > 0) {
[java] this.this$01.reportOptions.put("noteTypes", Long.valueOf(val));
[java] } else {
[java] this.this$01.reportOptions.remove("noteTypes");
[java] }
[java] }
[java] com.google.gwt.dev.jjs.ast.JMethodBody
[java] [ERROR] at MasterWorkLogSearchReportPage.java(277): public void execute();
[java]
[java] com.google.gwt.dev.jjs.ast.JMethod
I fixed the problem by creating a new Eclipse project and importing the same code. This was probably some type of caching issue, but cleaning out my gwt-unitCache directory did not fix it.