Ant parallel execution – Error with emma code coverage


In our project we tried to run ant tasks in parallel. We were parallelizing emma code coverage task with some other independent build tasks.
At that time we were getting this error:

../project/build.xml:157: java.lang.ExceptionInInitializerError
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:116)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
...
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.ExceptionInInitializerError
at com.vladium.emma.Processor.run(Processor.java:40)
at com.vladium.emma.instr.instrTask.execute(instrTask.java:77)
at com.vladium.emma.emmaTask.execute(emmaTask.java:57)
...
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
... 31 more
Caused by: java.lang.IllegalArgumentException: null or corrupt input: out
at com.vladium.logging.Logger.create(Logger.java:74)
at com.vladium.logging.Logger.(Logger.java:604)
... 39 more

On analysing this we found a open defect in emma which is linked here:
http://sourceforge.net/tracker/index.php?func=detail&aid=1641403&group_id=108932&atid=651897

Then on further debugging it, I found that the code in some of the logging portion in ant is obtaining locks and releasing it. Then we found out that the defect is in ant. We were running ant 1.7.1 at that time. I upgraded the ant to 1.8.1 and it solved the problem.

In ant 1.8.1, the locks which were obtained and released in logging was removed and an advanced lockless way of logging was introduced.

I hope this is useful for others debugging this issue.

Advertisements

One thought on “Ant parallel execution – Error with emma code coverage

  1. Many thanks for this tip – this was causing major headaches for me.

    An additional note – I found it quite hard to rebuild emma on a system with a new default java and ant installation – before you go down this route, check out the “emma” package in the Fedora repository (f.e. by searching it on http://rpm.pbone.net). This package contains the patched jars already, dated back to Apr 25, 2008. While this patch _should_ have also landed in JPackage’s noarch rpm for emma, its unfortunately not, so the Fedora rpm is the best choice so far.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s