Note that there are some explanatory texts on larger screens.

plurals
  1. POJenkins + Play 1.2.4 : problems with cobertura lock files / report
    text
    copied!<p>We have a Play 1.2.4 application and we got Jenkins (on Ubuntu) for the application. We're having problems with Cobertura. </p> <p>After running the tests (succesfully), every now and then, we get the following error:</p> <pre><code>--------------------------------------- java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at net.sourceforge.cobertura.util.FileLocker.lock(FileLocker.java:124) at play.modules.cobertura.CoberturaPlugin$CoberturaPluginShutdownThread.run(Unknown Source) Caused by: java.nio.channels.OverlappingFileLockException at sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166) at sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068) at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:824) at java.nio.channels.FileChannel.lock(FileChannel.java:860) ... 6 more --------------------------------------- Unable to get lock on /var/lib/jenkins/jobs/project/workspace/cobertura.ser.lock: null This is known to happen on Linux kernel 2.6.20. Make sure cobertura.jar is in the root classpath of the jvm process running the instrumented code. If the instrumented code is running in a web server, this means cobertura.jar should be in the web server's lib directory. Don't put multiple copies of cobertura.jar in different WEB-INF/lib directories. Only one classloader should load cobertura. It should be the root classloader. --------------------------------------- lock file could not be deleted </code></pre> <p>This doesn't seem to "break the build" but further down the build, we get the following (which causes the cobertura reports to fail)</p> <pre><code>Publishing Cobertura coverage report... No coverage results were found using the pattern 'test-result/code-coverage/coverage.xml' relative to '/var/lib/jenkins/jobs/project/workspace'. Did you enter a pattern relative to the correct directory? Did you generate the XML report(s) for Cobertura? Build step 'Publish Cobertura Coverage Report' changed build result to FAILURE </code></pre> <p>Running a subsequent build manually usually passes.</p> <p>According to <a href="https://stackoverflow.com/questions/2148886/zero-code-coverage-with-cobertura-1-9-2-but-tests-are-working">Zero code coverage with cobertura 1.9.2 but tests are working</a> , I tried setting <em>-Dcobertura.use.java.nio=false</em> after play auto-test -command.</p> <p>As this error was happening only now and then, I'm not totally sure if this helped. But after that, we got a problem with play auto-test hanging:</p> <pre><code> ... Executing /opt/play-1.2.4/play auto-test "/var/lib/jenkins/jobs/project/workspace" -Dcobertura.use.java.nio=false [workspace] $ /opt/play-1.2.4/play auto-test "/var/lib/jenkins/jobs/project/workspace" -Dcobertura.use.java.nio=false &lt;build stuck here for a couple of days&gt; </code></pre> <p>Since nothing has been totally deterministic, it's a bit difficult to say about causalities here. (This seems to happen after one or two builds after jenkins/server restart)</p> <p>Currently I'm considering disabling Cobertura in our project, but if somebody has other ideas, that would be great =)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload