我的GWT编译器因NoSuchMethodError而失败。当我将方法参数从Long更新为long时,它开始发生。我不应该,但我尝试将其切换回来,我仍然有同样的错误。我的java eclipse运行时编译器没有将该行视为错误,并且在开发模式下一切正常。
Caused by: java.lang.NoSuchMethodError: com.dscicorp.ribeye.shared.dto.Data.put(Ljava/lang/String;Ljava/lang/Long)Ljava/lang/String;
所以看起来它将long和Long视为不同的类型。这是实际方法的样子:
public String put(String key, long value) {
return put(key, Long.toString(value));
}
我不确定这是否与它有关但在错误消息中输出的行与我的代码中的行略有不同。它将长变量“val”替换为“Long.valueOf(val)”。
this.this$01.reportOptions.put("noteTypes", Long.valueOf(val))
我尝试添加long和Long版本以查看它是否已经过了这个问题,但它确实在另一个地方出现了类似错误。这是一个GWT错误还是我可能配置错误的东西?
这是完整的编译器日志:
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
答案 0 :(得分:1)
我通过创建一个新的Eclipse项目并导入相同的代码来解决问题。这可能是某种类型的缓存问题,但清理我的gwt-unitCache目录并没有修复它。