GWT 编译器 FileNotFoundException for permutation-0.js during linking

GWT compiler FileNotFoundException for permutation-0.js during linking

我在构建服务器上构建 GWT 应用程序时遇到间歇性问题。有时构建会失败并出现以下错误:

Unable to instantiate object java.io.FileNotFoundException: /tmp/gwtc3983507944098316106.tmp/com.mycompany.mygwtapplication.mymodule/compiler/permutation-0.js (No such file or directory)

我可以从构建日志中看到,Permutation 0 已成功构建。但是,/tmp 中的这个目录被删除了,所以我无法验证文件排列-0.js 文件是否确实存在于 link 时间。我尝试按照建议将 logLevel 设置为 DEBUG,但这导致每次构建创建 100GB 日志文件,因此不幸的是它不实用。我正在使用 GWT 2.7.0 和 GXT 4.0.1。我使用 Maven 作为构建工具,使用 Jenkins 作为构建服务器。当我使用 m2e 在我的 eclipse 工作站上本地构建时,不会发生此错误。由于这只是有时发生,所以我无法可靠地重现该问题。重新构建相同的代码通常会解决问题,但我们依赖构建服务器为我们的 QA 和支持团队实现自动化和一致。是什么导致了这个错误?如果需要,我可以尝试释放 space 用于调试输出,但我想先用尽其他选项。以下是构建日志以外的示例:

...
[INFO] Compiling module com.mycompany.mygwtapplication.mymodule
[INFO]    Ignored 1 unit with compilation errors in first pass.
[INFO] Compile with -strict or with -logLevel set to TRACE or DEBUG to see all errors.
[INFO]    Compiling 42 permutations
[INFO]       Compiling permutation 0...
[INFO]       Compiling permutation 1...
[INFO]       Compiling permutation 2...
[INFO]       Compiling permutation 3...
[INFO]       Compiling permutation 4...
[INFO]       Compiling permutation 5...
[INFO]       Compiling permutation 6...
[INFO]       Compiling permutation 7...
[INFO]       Compiling permutation 8...
[INFO]       Compiling permutation 9...
[INFO]       Compiling permutation 10...
[INFO]       Compiling permutation 11...
[INFO]       Compiling permutation 12...
[INFO]       Compiling permutation 13...
[INFO]       Compiling permutation 14...
[INFO]       Compiling permutation 15...
[INFO]       Compiling permutation 16...
[INFO]       Compiling permutation 17...
[INFO]       Compiling permutation 18...
[INFO]       Compiling permutation 19...
[INFO]       Compiling permutation 20...
[INFO]       Compiling permutation 21...
[INFO]       Compiling permutation 22...
[INFO]       Compiling permutation 23...
[INFO]       Compiling permutation 24...
[INFO]       Compiling permutation 25...
[INFO]       Compiling permutation 26...
[INFO]       Compiling permutation 27...
[INFO]       Compiling permutation 28...
[INFO]       Compiling permutation 29...
[INFO]       Compiling permutation 30...
[INFO]       Compiling permutation 31...
[INFO]       Compiling permutation 32...
[INFO]       Compiling permutation 33...
[INFO]       Compiling permutation 34...
[INFO]       Compiling permutation 35...
[INFO]       Compiling permutation 36...
[INFO]       Compiling permutation 37...
[INFO]       Compiling permutation 38...
[INFO]       Compiling permutation 39...
[INFO]       Compiling permutation 40...
[INFO]       Compiling permutation 41...
[INFO]    Compile of permutations succeeded
[INFO]    Compilation succeeded -- 181.222s
[INFO] Linking into /var/lib/jenkins/workspace/MyGWTModule-CI/target/myapplication-webcontent/login
[INFO]    [ERROR] Unable to instantiate object
[INFO] java.io.FileNotFoundException: /tmp/gwtc4151238126548020139.tmp/com.mycompany.mygwtapplication.mymodule/compiler/permutation-0.js (No such file or directory)
[INFO]  at java.io.FileInputStream.open0(Native Method)
[INFO]  at java.io.FileInputStream.open(FileInputStream.java:195)
[INFO]  at java.io.FileInputStream.<init>(FileInputStream.java:138)
[INFO]  at com.google.gwt.dev.util.Util.readFileAsObject(Util.java:667)
[INFO]  at com.google.gwt.dev.util.FileBackedObject.newInstance(FileBackedObject.java:74)
[INFO]  at com.google.gwt.dev.util.FileBackedObject.newInstance(FileBackedObject.java:32)
[INFO]  at com.google.gwt.dev.Link.finishPermutation(Link.java:479)
[INFO]  at com.google.gwt.dev.Link.doSimulatedShardingLink(Link.java:450)
[INFO]  at com.google.gwt.dev.Link.link(Link.java:182)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:246)
[INFO]  at com.google.gwt.dev.Compiler.run(Compiler.java:158)
[INFO]  at com.google.gwt.dev.Compiler.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] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 03:29 min
[INFO] Finished at: 2018-02-12T14:09:02-05:00
[INFO] Final Memory: 62M/733M
[INFO] ------------------------------------------------------------------------
...

如果您在控制台输出中看到类似的内容:

Ignored 1 unit with compilation errors in first pass.

GWT 编译失败并出现一个或多个错误。要获取有关错误的更多信息,请添加:

-logLevel TRACE

-strict 

(如 Colin 所述)到您的 DevMode 参数。

一旦发生错误,使用-strict将强制编译器停止。 使用 -logLevel TRACE 将产生错误发生的信息。搜索 'ERROR' 以查找控制台输出中的所有错误。

如果您使用的是 Eclipse,请确保您已取消选中 'Limit consule output' 以查看所有消息。