Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
5.1.0
-
None
-
windows
-
Patch Available
Description
QuickJPAStoreRecoveryBrokerTest.testQueueNonPersistentMessagesLostOnRestart can fail with the stack trace below.
the problem is that the vmtransport can be persisting data while the broker is attempting to close the persistence adapter.
The brokerService has a comment to have the VMTransport shuts down after the services, but puts it last of all. Moving the shutdown of the vmtransport to just before the persistence adapter shutdown works better for this test case.
[08:16:01]: org.apache.activemq.broker.store.QuickJPAStoreRecoveryBrokerTest (21s)
[08:16:01]: [org.apache.activemq.broker.store.QuickJPAStoreRecoveryBrokerTest] testTopicDurableConsumerHoldsPersistentMessageAfterRestart (1s)
[08:16:01]: [testTopicDurableConsumerHoldsPersistentMessageAfterRestart]
[08:16:01]: [testTopicDurableConsumerHoldsPersistentMessageAfterRestart] &openjpa-1.0.0-r420667:568756 nonfatal user error& org.apache.openjpa.persistence.InvalidStateException: This operation failed for some instances. See the nested exceptions array for details.
at org.apache.openjpa.kernel.AbstractBrokerFactory.assertNoActiveTransaction(AbstractBrokerFactory.java:696)
at org.apache.openjpa.kernel.AbstractBrokerFactory.close(AbstractBrokerFactory.java:373)
at org.apache.openjpa.kernel.DelegatingBrokerFactory.close(DelegatingBrokerFactory.java:183)
at org.apache.openjpa.persistence.EntityManagerFactoryImpl.close(EntityManagerFactoryImpl.java:286)
at org.apache.activemq.store.jpa.JPAPersistenceAdapter.stop(JPAPersistenceAdapter.java:198)
at org.apache.activemq.store.amq.AMQPersistenceAdapter.stop(AMQPersistenceAdapter.java:307)
at org.apache.activemq.util.ServiceStopper.stop(ServiceStopper.java:41)
at org.apache.activemq.broker.BrokerService.stop(BrokerService.java:484)
at org.apache.activemq.broker.BrokerTestSupport.tearDown(BrokerTestSupport.java:101)
at junit.framework.TestCase.runBare(TestCase.java:130)
at org.apache.activemq.CombinationTestSupport.runBare(CombinationTestSupport.java:90)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:210)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:135)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:122)
at org.apache.maven.surefire.Surefire.run(Surefire.java:129)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:225)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:747)
Caused by: &openjpa-1.0.0-r420667:568756 nonfatal user error& org.apache.openjpa.persistence.InvalidStateException: This operation cannot be performed while a Transaction is active.
FailedObject: org.apache.openjpa.persistence.EntityManagerImpl@1f23ca4
at org.apache.openjpa.kernel.AbstractBrokerFactory.assertNoActiveTransaction(AbstractBrokerFactory.java:690)
... 30 more