Maven 2.x Cobertura Plugin

"IllegalStateException: Shutdown in progress" during test

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.2
  • Fix Version/s: 2.3
  • Component/s: None
  • Labels:
    None
  • Environment:
    Linux 2.6.18 x86 32 bit
    Java Sun JDK 1.6.0_14
    Maven 2.0.10
  • Number of attachments :
    3

Description

Instrumentation seems to go okay but during the compilation of test coverage there is an exception that causes all coverage stats to be zero. The problem is only on Linux, on Windows it is fine.

[INFO] [cobertura:instrument]
[INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file
Instrumenting 5 files to /export/boreeng/jeff-temp/trunk/target/generated-classes/cobertura
Cobertura: Saved information on 5 classes.
Instrument time: 377ms

[INFO] Instrumentation was successful.
[INFO] [resources:testResources]
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /export/boreeng/jeff-temp/trunk/src/test/resources
[INFO] [compiler:testCompile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test]
[INFO] Surefire report directory: /export/boreeng/jeff-temp/trunk/target/surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------
Running com.iontrading.backoffice.model.SecurityTypeTest
Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.109 sec

Results :

Tests run: 4, Failures: 0, Errors: 0, Skipped: 0

Exception in thread "Thread-0" java.lang.ExceptionInInitializerError
at java.io.File.deleteOnExit(File.java:939)
at net.sourceforge.cobertura.util.FileLocker.<init>(FileLocker.java:80)
at net.sourceforge.cobertura.coveragedata.ProjectData.saveGlobalProjectData(ProjectData.java:230)
at net.sourceforge.cobertura.coveragedata.SaveTimer.run(SaveTimer.java:31)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalStateException: Shutdown in progress
at java.lang.Shutdown.add(Shutdown.java:62)
at java.lang.System$2.registerShutdownHook(System.java:1146)
at java.io.DeleteOnExitHook.<clinit>(DeleteOnExitHook.java:20)
... 5 more
[INFO] Preparing findbugs:findbugs
[INFO] [resources:resources]

  1. Dummy.java
    09/Jun/09 2:32 PM
    0.1 kB
    Jeff Johnston
  2. DummyTest.java
    09/Jun/09 2:32 PM
    0.2 kB
    Jeff Johnston
  3. pom.xml
    09/Jun/09 2:32 PM
    2 kB
    Jeff Johnston

Activity

Hide
Jeff Johnston added a comment -

I was wrong when I said that the issue was OS dependent. Actually the problem is with JDK 1.6.0_14. There is no problem with JDK 1.6.0_13. The issue is the same on both Windows and Linux.

Show
Jeff Johnston added a comment - I was wrong when I said that the issue was OS dependent. Actually the problem is with JDK 1.6.0_14. There is no problem with JDK 1.6.0_13. The issue is the same on both Windows and Linux.
Hide
Jeff Johnston added a comment -

These three files form a minimal project that will recreate the issue. Put Dummy.java in src/main/java/mrjeffjohnston. Put DummyTest.java in src/test/java/mrjeffjohnston. Run "mvn cobertura:cobertura" to recreate the issue. A stack trace is thrown with JDK 1.6.0_14 and the coverage report is all 0%. With JDK 1.6.0_13 there is no stack trace and the coverage report is correct at 100%

Show
Jeff Johnston added a comment - These three files form a minimal project that will recreate the issue. Put Dummy.java in src/main/java/mrjeffjohnston. Put DummyTest.java in src/test/java/mrjeffjohnston. Run "mvn cobertura:cobertura" to recreate the issue. A stack trace is thrown with JDK 1.6.0_14 and the coverage report is all 0%. With JDK 1.6.0_13 there is no stack trace and the coverage report is correct at 100%
Hide
Michael Osipov added a comment -

I do have the same issue with update 14 and xp sp2.

Show
Michael Osipov added a comment - I do have the same issue with update 14 and xp sp2.
Hide
Paul Woods added a comment -

Cobertura 1.9.2 fixes the problem with java 1.6.0.14 (see the news section of http://cobertura.sourceforge.net)

I added this dependency to my applications' pom:

<dependency>
    <groupId>net.sourceforge.cobertura</groupId>
    <artifactId>cobertura</artifactId>
    <version>1.9.2</version>
</dependency>

It seems to fix the problem.

Show
Paul Woods added a comment - Cobertura 1.9.2 fixes the problem with java 1.6.0.14 (see the news section of http://cobertura.sourceforge.net) I added this dependency to my applications' pom:
<dependency>
    <groupId>net.sourceforge.cobertura</groupId>
    <artifactId>cobertura</artifactId>
    <version>1.9.2</version>
</dependency>
It seems to fix the problem.
Hide
Jeff Johnston added a comment -

This issue is fixed in version 2.3 of the plugin which uses Cobertura 1.9.2 as Paul mentions above.

Show
Jeff Johnston added a comment - This issue is fixed in version 2.3 of the plugin which uses Cobertura 1.9.2 as Paul mentions above.
Hide
Brian Hanafee added a comment -

Adding for the sake of bug repository search terms:
This issue also affects Mac OSX 10.6.1 Snow Leopard with Maven 2.0.9 and Java 1.6.0.15
Version 2.3 of the plugin fixes the issue, as described above.

Show
Brian Hanafee added a comment - Adding for the sake of bug repository search terms: This issue also affects Mac OSX 10.6.1 Snow Leopard with Maven 2.0.9 and Java 1.6.0.15 Version 2.3 of the plugin fixes the issue, as described above.

People

Vote (10)
Watch (9)

Dates

  • Created:
    Updated:
    Resolved: