Maven test does not complete
When i run a mvn test Maven runs all the tests successfully and then goes on a wait infinite loop I see a java process in the task manager and I have to kill it before maven returns with this error message
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ----------------------------------------------开发者_JAVA技巧--------------------------
[INFO] Total time: 1:33.949s
[INFO] Finished at: Fri Jun 17 14:50:01 EDT 2011
[INFO] Final Memory: 5M/247M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.
4:test (default-test) on project EDIFileHandling: There are test failures.
[ERROR]
[ERROR] Please refer to c:\code\target\surefire-reports for the individual test
results.
Any help appreciated.
Thanks
R
C:\Users\Raghuveer.Rao>jstack 7256
2011-06-17 15:24:55
Full thread dump Java HotSpot(TM) Client VM (20.0-b11 mixed mode, sharing):
"Thread-2" prio=6 tid=0x03ed3000 nid=0x14d0 waiting for monitor entry [0x04ddf00 0] java.lang.Thread.State: BLOCKED (on object monitor) at org.hsqldb.Session.close(Unknown Source) - waiting to lock <0x23ba76f0> (a org.hsqldb.Session) at org.hsqldb.SessionManager.closeAllSessions(Unknown Source) - locked <0x292ce828> (a org.hsqldb.SessionManager) at org.hsqldb.Database.close(Unknown Source) at org.hsqldb.StatementCommand.getResult(Unknown Source) at org.hsqldb.StatementCommand.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.executeDirectStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) - locked <0x23b8efe8> (a org.hsqldb.Session) at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source) - locked <0x23b90f30> (a org.hsqldb.jdbc.JDBCStatement) at org.springframework.jdbc.datasource.embedded.AbstractEmbeddedDatabase Configurer.shutdown(AbstractEmbeddedDatabaseConfigurer.java:42) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory. shutdownDatabase(EmbeddedDatabaseFactory.java:184) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryB ean.destroy(EmbeddedDatabaseFactoryBean.java:57) at org.springframework.beans.factory.support.DisposableBeanAdapter.destr oy(DisposableBeanAdapter.java:184) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroyBean(DefaultSingletonBeanRegistry.java:487) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingleton(DefaultSingletonBeanRegistry.java:463) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingletons(DefaultSingletonBeanRegistry.java:431) - locked <0x2951f1c0> (a java.util.LinkedHashMap) at org.springframework.context.support.AbstractApplicationContext.destro yBeans(AbstractApplicationContext.java:1048) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:1022) at org.springframework.context.support.AbstractApplicationContext$3.run( AbstractApplicationContext.java:940)
"Thread-1" prio=6 tid=0x03ed2c00 nid=0x1fe0 waiting for monitor entry [0x04d8f00 0] java.lang.Thread.State: BLOCKED (on object monitor) at org.hsqldb.SessionManager.closeAllSessions(Unknown Source) - waiting to lock <0x292ce828> (a org.hsqldb.SessionManager) at org.hsqldb.Database.close(Unknown Source) at org.hsqldb.StatementCommand.getResult(Unknown Source) at org.hsqldb.StatementCommand.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.executeDirectStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) - locked <0x23ba76f0> (a org.hsqldb.Session) at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source) - locked <0x23ba9568> (a org.hsqldb.jdbc.JDBCStatement) at org.springframework.jdbc.datasource.embedded.AbstractEmbeddedDatabase Configurer.shutdown(AbstractEmbeddedDatabaseConfigurer.java:42) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory. shutdownDatabase(EmbeddedDatabaseFactory.java:184) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryB ean.destroy(EmbeddedDatabaseFactoryBean.java:57) at org.springframework.beans.factory.support.DisposableBeanAdapter.destr oy(DisposableBeanAdapter.java:184) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroyBean(DefaultSingletonBeanRegistry.java:487) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingleton(DefaultSingletonBeanRegistry.java:463) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingletons(DefaultSingletonBeanRegistry.java:431) - locked <0x2910d510> (a java.util.LinkedHashMap) at org.springframework.context.support.AbstractApplicationContext.destro yBeans(AbstractApplicationContext.java:1048) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:1022) at org.springframework.context.support.AbstractApplicationContext$3.run( AbstractApplicationContext.java:940)
"Low Memory Detector" daemon prio=6 tid=0x01bdac00 nid=0x1eb0 runnable [0x000000 00] java.lang.Thread.State: RUNNABLE
"C1 CompilerThread0" daemon prio=10 tid=0x01bc8400 nid=0x18e8 waiting on conditi on [0x00000000] java.lang.Thread.State: RUNNABLE
"Attach Listener" daemon prio=10 tid=0x01bc5400 nid=0x1ac0 waiting on condition [0x00000000] java.lang.Thread.State: RUNNABLE
"Signal Dispatcher" daemon prio=10 tid=0x01bc2400 nid=0x1fbc runnable [0x0000000 0] java.lang.Thread.State: RUNNABLE
"Finalizer" daemon prio=8 tid=0x01bbb800 nid=0x1c00 in Object.wait() [0x03cdf000 ] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x290702b0> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118) - locked <0x290702b0> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134) at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
"Reference Handler" daemon prio=10 tid=0x01bba000 nid=0x810 in Object.wait() [0x 03c8f000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x29070340> (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Object.java:485) at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116) - locked <0x29070340> (a java.lang.ref.Reference$Lock)
"main" prio=6 tid=0x00e29800 nid=0x1e20 in Object.wait() [0x001bf000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x294c4300> (a org.springframework.context.support.Abstrac tApplicationContext$3) at java.lang.Thread.join(Thread.java:1186) - locked <0x294c4300> (a org.springframework.context.support.AbstractApp licationContext$3) at java.lang.Thread.join(Thread.java:1239) at java.lang.ApplicationShutdownHooks.runHooks(ApplicationShutdownHooks. java:79) at java.lang.ApplicationShutdownHooks$1.run(ApplicationShutdownHooks.jav a:24) at java.lang.Shutdown.runHooks(Shutdown.java:79) at java.lang.Shutdown.sequence(Shutdown.java:123) at java.lang.Shutdown.exit(Shutdown.java:168) - locked <0x38b53ef8> (a java.lang.Class for java.lang.Shutdown) at java.lang.Runtime.exit(Runtime.java:90) at java.lang.System.exit(System.java:904) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.j ava:986)
"VM Thread" prio=10 tid=0x01b7e400 nid=0x1e10 runnable
"VM Periodic Task Thread" prio=10 tid=0x01bec800 nid=0x1bac waiting on condition
JNI global references: 1776
Found one Java-level deadlock:
"Thread-2": waiting to lock monitor 0x0467c1cc (object 0x23ba76f0, a org.hsqldb.Session), which is held by "Thread-1" "Thread-1": waiting to lock monitor 0x01bbf56c (object 0x292ce828, a org.hsqldb.SessionMan ager), which is held by "Thread-2"
Java stack information for the threads listed above:
"Thread-2": at org.hsqldb.Session.close(Unknown Source) - waiting to lock <0x23ba76f0> (a org.hsqldb.Session) at org.hsqldb.SessionManager.closeAllSessions(Unknown Source) - locked <0x292ce828> (a org.hsqldb.SessionManager) at org.hsqldb.Database.close(Unknown Source) at org.hsqldb.StatementCommand.getResult(Unknown Source) at org.hsqldb.StatementCommand.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.executeDirectStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) - locked <0x23b8efe8> (a org.hsqldb.Session) at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source) - locked <0x23b90f30> (a org.hsqldb.jdbc.JDBCStatement) at org.springframework.jdbc.datasource.embedded.AbstractEmbeddedDatabase Configurer.shutdown(AbstractEmbeddedDatabaseConfigurer.java:42) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory. shutdownDatabase(EmbeddedDatabaseFactory.java:184) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryB ean.destroy(EmbeddedDatabaseFactoryBean.java:57) at org.springframework.beans.factory.support.DisposableBeanAdapter.destr oy(DisposableBeanAdapter.java:184) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroyBean(DefaultSingletonBeanRegistry.java:487) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingleton(DefaultSingletonBeanRegistry.java:463) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingletons(DefaultSingletonBeanRegistry.java:431) - locked <0x2951f1c0> (a java.util.LinkedHashMap) at org.springframework.context.support.AbstractApplicationContext.destro yBeans(AbstractApplicationContext.java:1048) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:1022) at org.springframework.context.support.AbstractApplicationContext$3.run( AbstractApplicationContext.java:940) "Thread-1": at org.hsqldb.SessionManager.closeAllSessions(Unknown Source) - waiting to lock <0x292ce828> (a org.hsqldb.SessionManager) at org.hsqldb.Database.close(Unknown Source) at org.hsqldb.StatementCommand.getResult(Unknown Source) at org.hsqldb.StatementCommand.execute(Unknown Source) at org.hsqldb.Session.executeCompiledStatement(Unknown Source) at org.hsqldb.Session.executeDirectStatement(Unknown Source) at org.hsqldb.Session.execute(Unknown Source) - locked <0x23ba76f0> (a org.hsqldb.Session) at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source) at org.hsqldb.jdbc.JDBCStatement.execute(Unknown Source) - locked <0x23ba9568> (a org.hsqldb.jdbc.JDBCStatement) at org.springframework.jdbc.datasource.embedded.AbstractEmbeddedDatabase Configurer.shutdown(AbstractEmbeddedDatabaseConfigurer.java:42) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactory. shutdownDatabase(EmbeddedDatabaseFactory.java:184) at org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryB ean.destroy(EmbeddedDatabaseFactoryBean.java:57) at org.springframework.beans.factory.support.DisposableBeanAdapter.destr oy(DisposableBeanAdapter.java:184) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroyBean(DefaultSingletonBeanRegistry.java:487) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingleton(DefaultSingletonBeanRegistry.java:463) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistr y.destroySingletons(DefaultSingletonBeanRegistry.java:431) - locked <0x2910d510> (a java.util.LinkedHashMap) at org.springframework.context.support.AbstractApplicationContext.destro yBeans(AbstractApplicationContext.java:1048) at org.springframework.context.support.AbstractApplicationContext.doClos e(AbstractApplicationContext.java:1022) at org.springframework.context.support.AbstractApplicationContext$3.run( AbstractApplicationContext.java:940)
Found 1 deadlock.
C:\Users\Raghuveer.Rao>
Maven surefire plugin by default spawns a new process to run the tests. This is probably the process you are killing. When maven notices its child process was interrupted, it probably assummes that the tests failed.
Have a look at /target/surefire-reports
for confirmation. What you can do to help us diagnose the problem is to find the surefire process id (the one you are killing) and run:
$ jstack ID
Stack dump will tell you what is causing the test to hung.
精彩评论