升级到新版本的 GWT 时,os X 上的 eclipse 中的 GWT 编译失败
当我升级到最新版本的 GWT 时,尝试编译代码时出现以下错误。
Compiling module com.blah
[ERROR] Errors in 'file://Path/To/GWT/src/client/CatalogTabs.java'
[ERROR] Internal compiler error
java.lang.IncompatibleClassChangeError: Found interface com.google.gwt.core.ext.typeinfo.JEnumType, but class was expected
at com.google.gwt.uibinder.attributeparsers.EnumAttributeParser.<init>(EnumAttributeParser.java:35)
at com.google.gwt.uibinder.attributeparsers.AttributeParsers.<init>(AttributeParsers.java:88)
at com.google.gwt.uibinder.rebind.UiBinderWriter.<init>(UiBinderWriter.java:271)
at com.google.gwt.uibinder.rebind.UiBinderGenerator.generateOnce(UiBinderGenerator.java:135)
at com.google.gwt.uibinder.rebind.UiBinderGenerator.generate(UiBinderGenerator.java:119)
at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:662)
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:74)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:259)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:248)
at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:106)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:254)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:175)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:288)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:145)
at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:632)
at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:124)
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:54)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:517)
at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:35)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:541)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:495)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:407)
at com.google.gwt.dev.Compiler.run(Compiler.java:215)
at com.google.gwt.dev.Compiler.run(Compiler.java:187)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:159)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
at com.google.gwt.dev.Compiler.main(Compiler.java:166)
如果我创建一个新项目并复制所有代码等,则构建将正常工作。
When I upgrade to the newest version of GWT, I get the following error when I try to compile my code.
Compiling module com.blah
[ERROR] Errors in 'file://Path/To/GWT/src/client/CatalogTabs.java'
[ERROR] Internal compiler error
java.lang.IncompatibleClassChangeError: Found interface com.google.gwt.core.ext.typeinfo.JEnumType, but class was expected
at com.google.gwt.uibinder.attributeparsers.EnumAttributeParser.<init>(EnumAttributeParser.java:35)
at com.google.gwt.uibinder.attributeparsers.AttributeParsers.<init>(AttributeParsers.java:88)
at com.google.gwt.uibinder.rebind.UiBinderWriter.<init>(UiBinderWriter.java:271)
at com.google.gwt.uibinder.rebind.UiBinderGenerator.generateOnce(UiBinderGenerator.java:135)
at com.google.gwt.uibinder.rebind.UiBinderGenerator.generate(UiBinderGenerator.java:119)
at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:662)
at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:74)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:259)
at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:248)
at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:106)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:254)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:175)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:288)
at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:145)
at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:632)
at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:124)
at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:54)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:517)
at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:35)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:541)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:495)
at com.google.gwt.dev.Precompile.precompile(Precompile.java:407)
at com.google.gwt.dev.Compiler.run(Compiler.java:215)
at com.google.gwt.dev.Compiler.run(Compiler.java:187)
at com.google.gwt.dev.Compiler$1.run(Compiler.java:159)
at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
at com.google.gwt.dev.Compiler.main(Compiler.java:166)
If I create a new project and copy all my code etc, the build will work just fine.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不是 100% 确定,但我认为 gwt 编译器从 2.1 到 2.2 发生了变化,这使得有必要使用较新的编译器重新编译所有使用的 gwt 库。
如果您有在编译时生成代码的依赖项(很多都有),请查看 google 开发人员的这篇文章: http://groups.google.com/group/google-web-toolkit/browse_thread/thread/3cdbe1bcd6966957
I am not 100% sure but there was a change in the gwt compiler from 2.1 to 2.2 I think, which makes it necessary to recompile all used gwt libraries with the newer compiler.
If you have dependencies which generate code at compile time (many do), take a look at this post from a google dev: http://groups.google.com/group/google-web-toolkit/browse_thread/thread/3cdbe1bcd6966957