Clover for Ant raises "Error finalising instrumentation"

The project will build and test fine without clover via ant clean build unittests. However, when try to integrate clover via ant -lib ejb-3.7.1.jar with.clover build unittests clover.report it ends up returning "Error finalising instrumentation" and the following stack trace:

clover Error finalising instrumentation:
clover java.io.IOException: Failed to move tmp registry file /myproject/.clover/clover3_1_6.db.tmp to final registry filejava.io.IOException: Failed to move tmp registry file /myproject/.clover/clover3_1_6.db.tmp to final registry file
clover at com.atlassian.clover.registry.format.FreshRegFile.saveImpl(FreshRegFile.java:117)
clover at com.atlassian.clover.registry.format.FreshRegFile.saveImpl(FreshRegFile.java:18)
clover at com.atlassian.clover.registry.format.RegFile.save(RegFile.java:38)
clover at com.cenqua.clover.registry.Clover2Registry.saveAndOverwriteFile(Clover2Registry.java:268)
clover at com.cenqua.clover.registry.Clover2Registry.saveAndOverwriteFile(Clover2Registry.java:244)
clover at com.atlassian.clover.instr.java.Instrumenter.endInstrumentation(Instrumenter.java:289)
clover at com.atlassian.clover.instr.java.Instrumenter.endInstrumentation(Instrumenter.java:280)
clover at org.apache.tools.ant.taskdefs.CloverCompilerAdapter.setJavac(CloverCompilerAdapter.java:226)
clover at com.mycompany.ant.taskdefs.YJavaC.compile(Unknown Source)
clover at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:930)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
clover at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
clover at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
clover at net.sf.antcontrib.logic.IfTask.execute(IfTask.java:197)
clover at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.TaskAdapter.execute(TaskAdapter.java:154)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
clover at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at net.sf.antcontrib.logic.OutOfDate.execute(OutOfDate.java:457)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
clover at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
clover at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
clover at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
clover at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
clover at java.lang.reflect.Method.invoke(Method.java:616)
clover at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
clover at org.apache.tools.ant.Task.perform(Task.java:348)
clover at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run(Parallel.java:435)
clover at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run(Parallel.java:435)
clover at java.lang.Thread.run(Thread.java:679)
clover java.io.IOException: Failed to move tmp registry file /myproject/.clover/clover3_1_6.db.tmp to final registry file
clover ** Error(s) occurred and the instrumentation process can't continue.

It seems clover is doing its thing during the build because I see lines like this frequently in the log:

javac Compiling 205 source files to /myproject/classes
clover Updating existing database at '/myproject/.clover/clover3_1_6.db'.
clover Clover all over. Instrumented 2 files (1 package).
clover Elapsed time = 0.005 secs. (400 files/sec, 12,800 srclines/sec)
clover Processing files at 1.6 source level.

1 answer

1 accepted

This widget could not be displayed.

The exception:

[clover] Error finalising instrumentation:
[clover] java.io.IOException: Failed to move tmp registry file 
/myproject/.clover/clover3_1_6.db.tmp to final registry file

means that Clover was unable to rename file from '/myproject/.clover/clover3_1_6.db.tmp' to '/myproject/.clover/clover3_1_6.db'. This kind of error is usually thrown when a parallel build is configured (by a <parallel> task, for instance).

Clover currently does not support parallel compilation, so you have to disable it in your build.

Regards
Marek

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted yesterday in Statuspage

What are your best incident management tips and stories? #HugOps

 👋Community members! Downtime happens. And great incident response takes a village. Teams like Support, Dev, SRE, Ops, IT, and Marketing have to come together to resolve the problem while keep...

81 views 4 3
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you