gpt4 book ai didi

java - 库源在 SuperDevMode 中不可用

转载 作者:行者123 更新时间:2023-11-30 03:32:51 25 4
gpt4 key购买 nike

我创建了一个演示项目here .

它使用 GWT 编译,在 Eclipse 中没有任何问题。当我在 SuperDevMode 下运行应用程序时,第一次编译失败并出现以下错误:

        Compiling 1 permutation
Compiling permutation 0...
[ERROR] An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:121)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:140)
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:132)
at com.google.gwt.dev.jjs.impl.Devirtualizer.getStaticImpl(Devirtualizer.java:562)
at com.google.gwt.dev.jjs.impl.Devirtualizer.access$400(Devirtualizer.java:75)
at com.google.gwt.dev.jjs.impl.Devirtualizer$RewriteVirtualDispatches.ensureDevirtualVersionExists(Devirtualizer.java:184)
at com.google.gwt.dev.jjs.impl.Devirtualizer$RewriteVirtualDispatches.endVisit(Devirtualizer.java:101)
at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:580)
at com.google.gwt.dev.jjs.ast.JModVisitor$ListContextImmutable.traverse(JModVisitor.java:183)
at com.google.gwt.dev.jjs.ast.JModVisitor.acceptWithInsertRemoveImmutable(JModVisitor.java:355)
at com.google.gwt.dev.jjs.ast.JInterfaceType.traverse(JInterfaceType.java:75)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:380)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:292)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:284)
at com.google.gwt.dev.jjs.ast.JProgram.visitModuleTypes(JProgram.java:1192)
at com.google.gwt.dev.jjs.ast.JProgram.traverse(JProgram.java:1156)
at com.google.gwt.dev.jjs.ast.JModVisitor.traverse(JModVisitor.java:380)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:292)
at com.google.gwt.dev.jjs.ast.JModVisitor.accept(JModVisitor.java:284)
at com.google.gwt.dev.jjs.impl.Devirtualizer.execImpl(Devirtualizer.java:320)
at com.google.gwt.dev.jjs.impl.Devirtualizer.exec(Devirtualizer.java:218)
at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler$MonolithicPermutationCompiler.normalizeSemantics(MonolithicJavaToJavaScriptCompiler.java:95)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:290)
at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:137)
... 27 more
[ERROR] <no source info>: <source info not available>
[ERROR] at JsonElement.java(19): public abstract JsonElement clear();

com.google.gwt.dev.jjs.ast.JMethod
[ERROR] at JsonElement.java(18): interface JsonElement extends Serializable
com.google.gwt.dev.jjs.ast.JInterfaceType
[ERROR] at Unknown(0): <JProgram>
com.google.gwt.dev.jjs.ast.JProgram
[ERROR] Unrecoverable exception, shutting down
com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries)
at com.google.gwt.dev.javac.CompilationProblemReporter.logAndTranslateException(CompilationProblemReporter.java:106)
at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler$PermutationCompiler.compilePermutation(JavaToJavaScriptCompiler.java:367)
at com.google.gwt.dev.jjs.MonolithicJavaToJavaScriptCompiler.compilePermutation(MonolithicJavaToJavaScriptCompiler.java:296)
at com.google.gwt.dev.jjs.UnifiedAst.compilePermutation(UnifiedAst.java:143)
at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:197)
at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
at java.lang.Thread.run(Thread.java:745)
[ERROR] Not all permutation were compiled , completed (0/1)
[WARN] recompile failed
[WARN] continuing to serve previous version

该库使用 <super-source path="super" />标签。从 GWT 文档中我发现 ( http://www.gwtproject.org/doc/latest/DevGuideOrganizingProjects.html )

“在开发模式下, native JRE 类始终取代从源代码编译的类。”

这是一个问题,因为我无法在 SuperDevMode 中使用该库。

有什么办法可以解决这个问题吗?我可以以某种方式省略 super-source 标签吗?

最佳答案

您使用的java代码没有为GWT准备,问题似乎是JsonElement,它可能来自com.google.gson,这是一个与GWT不兼容的库.

您可能会阅读 GWT 编码 compatibiltyjre仿真文档。

关于java - 库源在 SuperDevMode 中不可用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28613478/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com