Issue Details (XML | Word | Printable)

Key: MCOBERTURA-101
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Jeff Johnston
Votes: 10
Watchers: 8
Operations

If you were logged in you would be able to see more operations.
Maven 2.x Cobertura Plugin

"IllegalStateException: Shutdown in progress" during test

Created: 09/Jun/09 10:08 AM   Updated: 18/Oct/09 11:28 PM   Resolved: 10/Jul/09 03:56 AM
Return to search
Component/s: None
Affects Version/s: 2.2
Fix Version/s: 2.3

Time Tracking:
Not Specified

File Attachments: 1. Java Source File Dummy.java (0.1 kB)
2. Java Source File DummyTest.java (0.2 kB)
3. XML File pom.xml (2 kB)

Environment:
Linux 2.6.18 x86 32 bit
Java Sun JDK 1.6.0_14
Maven 2.0.10


 Description  « Hide

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]



Jeff Johnston added a comment - 09/Jun/09 01:37 PM

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.


Jeff Johnston added a comment - 09/Jun/09 02:32 PM

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%


Jeff Johnston made changes - 09/Jun/09 02:32 PM
Field Original Value New Value
Attachment DummyTest.java [ 42509 ]
Attachment Dummy.java [ 42508 ]
Attachment pom.xml [ 42507 ]
Evgeny Minkevich made changes - 11/Jun/09 01:09 AM
Comment [ I'm experiencing the problem on WinXP SP2 platform with JDK 1.6.3_13 as well. ]
Michael Osipov added a comment - 23/Jun/09 07:00 AM

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


Paul Woods added a comment - 10/Jul/09 01:14 AM

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.


Jeff Johnston added a comment - 10/Jul/09 03:55 AM

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


Jeff Johnston made changes - 10/Jul/09 03:56 AM
Resolution Fixed [ 1 ]
Fix Version/s 2.3 [ 13926 ]
Status Open [ 1 ] Closed [ 6 ]
Brian Hanafee added a comment - 18/Oct/09 11:28 PM

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.