I have an intermittent issue while building a GWT application on my build server. Sometimes a build will fail with the following error:
Unable to instantiate object java.io.FileNotFoundException: /tmp/gwtc3983507944098316106.tmp/com.mycompany.mygwtapplication.mymodule/compiler/permutation-0.js (No such file or directory)
I can see from the build log however that Permutation 0 sucessfully built. However, this directory in /tmp gets deleted so I can't verify if the file permutation-0.js file is actually present at link time. I have tried setting logLevel to DEBUG as suggested, but that led to the creation of 100GB log files per build, so it is unfortunately not practical. I am using GWT 2.7.0 and GXT 4.0.1. I am using Maven as my build tool, and Jenkins as my build server. This error does not occur when I build locally on my eclipse workstation with m2e. Since this only happens sometimes, I can't reliably replicate the issue. Building the same code over again will usually fix the issue, but we rely on the build server to be automated and consistent for our QA and support team. What could be causing this error? If needed, I could try freeing up the space for a debug output, but I'd like to exhaust other options first. The following is an example except from the build log:
...
[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$1.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] ------------------------------------------------------------------------
...
In case you see something like that in the console output:
Ignored 1 unit with compilation errors in first pass.
the GWT compiles fails with one or more errors. To get more informations about the error add:
-logLevel TRACE
or
-strict
(as Colin mentioned) to your DevMode arguments.
Using -strict
will force the compiler to stop, once an error occurs.
Using -logLevel TRACE
will produce information where the error occurs. Search for 'ERROR' to find all errors inside the console output.
If your are using eclipse, make sure, that you have unchecked the 'Limit consule output' to see all messages.