java.lang.IllegalStateException: Cannot deactivate transaction synchronization - not active

Spring JIRA | Costin Leau | 1 decade ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    The jcr project part of Spring Modules contains a Local TransactionManager for jackrabbit. After upgrading to 2.0-m5 or rc1 one of the tests if failing - it passes if 2.0-m4- is used. The stack trace is : java.lang.IllegalStateException: Cannot deactivate transaction synchronization - not active at org.springframework.transaction.support.TransactionSynchronizationManager.clearSynchronization(TransactionSynchronizationManager.java:261) at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:785) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:580) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:509) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at org.springmodules.jcr.jackrabbit.LocalTransactionManagerTests.testTransactionRollbackOnlyWithPrebound(LocalTransactionManagerTests.java:350) 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 junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) 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 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) while the test that fails is called testTransactionRollbackOnlyWithPrebound() and can be found here: https://springmodules.dev.java.net/source/browse/springmodules/projects/jcr/src/test/org/springmodules/jcr/jackrabbit/LocalTransactionManagerTests.java?rev=1.2&view=markup

    Spring JIRA | 1 decade ago | Costin Leau
    java.lang.IllegalStateException: Cannot deactivate transaction synchronization - not active
  2. 0

    The jcr project part of Spring Modules contains a Local TransactionManager for jackrabbit. After upgrading to 2.0-m5 or rc1 one of the tests if failing - it passes if 2.0-m4- is used. The stack trace is : java.lang.IllegalStateException: Cannot deactivate transaction synchronization - not active at org.springframework.transaction.support.TransactionSynchronizationManager.clearSynchronization(TransactionSynchronizationManager.java:261) at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:785) at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:580) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:509) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) at org.springmodules.jcr.jackrabbit.LocalTransactionManagerTests.testTransactionRollbackOnlyWithPrebound(LocalTransactionManagerTests.java:350) 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 junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) 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 org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) while the test that fails is called testTransactionRollbackOnlyWithPrebound() and can be found here: https://springmodules.dev.java.net/source/browse/springmodules/projects/jcr/src/test/org/springmodules/jcr/jackrabbit/LocalTransactionManagerTests.java?rev=1.2&view=markup

    Spring JIRA | 1 decade ago | Costin Leau
    java.lang.IllegalStateException: Cannot deactivate transaction synchronization - not active

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Cannot deactivate transaction synchronization - not active

      at org.springframework.transaction.support.TransactionSynchronizationManager.clearSynchronization()
    2. Spring Tx
      TransactionTemplate.execute
      1. org.springframework.transaction.support.TransactionSynchronizationManager.clearSynchronization(TransactionSynchronizationManager.java:261)
      2. org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:785)
      3. org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:580)
      4. org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:509)
      5. org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140)
      5 frames
    3. org.springmodules.jcr
      LocalTransactionManagerTests.testTransactionRollbackOnlyWithPrebound
      1. org.springmodules.jcr.jackrabbit.LocalTransactionManagerTests.testTransactionRollbackOnlyWithPrebound(LocalTransactionManagerTests.java:350)
      1 frame
    4. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:585)
      4 frames
    5. JUnit
      TestSuite.run
      1. junit.framework.TestCase.runTest(TestCase.java:154)
      2. junit.framework.TestCase.runBare(TestCase.java:127)
      3. junit.framework.TestResult$1.protect(TestResult.java:106)
      4. junit.framework.TestResult.runProtected(TestResult.java:124)
      5. junit.framework.TestResult.run(TestResult.java:109)
      6. junit.framework.TestCase.run(TestCase.java:118)
      7. junit.framework.TestSuite.runTest(TestSuite.java:208)
      8. junit.framework.TestSuite.run(TestSuite.java:203)
      8 frames
    6. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:478)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:344)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
      3 frames