java.lang.IllegalStateException: Active Spring transaction synchronization or jtaTransactionManager on LocalSessionFactoryBean plus active JTA transaction required

Spring JIRA | Victor | 1 decade ago
  1. 0

    In the afterPropertiesSet call of LocalSessionFactoryBean, the configTimeTransactionManagerHolder is set after mappingLocations, which is incorrect because mappingLocations will incur hibernate type mapping and the LobType will initialized with "null" jtaManager instance, and later cause the attached error. Moving the if (this.jtaTransactionManager != null) { // set Spring-provided JTA TransactionManager for Hibernate cache callbacks config.setProperty(Environment.TRANSACTION_MANAGER_STRATEGY, LocalTransactionManagerLookup.class.getName()); configTimeTransactionManagerHolder.set(this.jtaTransactionManager); } to the top of afterPropertiesSet will fix this bug. =================== [9/8/04 14:39:11:047 EDT] 7e2ed625 SystemOut U ERROR [ORB.thread.pool:1] (SessionFactoryUtils.java:743) - beforeCommit callback threw exception java.lang.IllegalStateException: Active Spring transaction synchronization or jtaTransactionManager on LocalSessionFactoryBean plus active JTA transaction required at org.springframework.orm.hibernate.support.AbstractLobType.nullSafeSet(AbstractLobType.java:169) at net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118) at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:393) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442) at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236) at org.springframework.orm.hibernate.SessionFactoryUtils$SpringSessionSynchronization.beforeCommit(SessionFactoryUtils.java:655) at org.springframework.orm.hibernate.SessionFactoryUtils$JtaSessionSynchronization.beforeCompletion(SessionFactoryUtils.java:740) at com.ibm.ejs.jts.jta.TransactionImpl.before_completion(TransactionImpl.java:966) at com.ibm.ejs.jts.jts.CoordinatorImpl$Sync.beforePrepare(CoordinatorImpl.java:692) at com.ibm.ejs.jts.tran.EventCallback.executeCallback(EventCallback.java:166) at com.ibm.ejs.jts.tran.EventCallback.executeCallbackTree(EventCallback.java:132) at com.ibm.ejs.jts.tran.EventPrepare.ExecuteBeforePrepareCallbacks(EventPrepare.java:297) at com.ibm.ejs.jts.tran.EventPrepare.event_LocalPrepareWork(EventPrepare.java:277) at com.ibm.ejs.jts.tran.EventPrepare.event_BecomeCoordinator(EventPrepare.java:960) at com.ibm.ejs.jts.tran.EventControl.event_EndTopLevel(EventControl.java:295) at com.ibm.ejs.jts.tran.TrecInterface.end(TrecInterface.java:88) at com.ibm.ejs.jts.jts.TerminatorImpl.commit(TerminatorImpl.java:89) at com.ibm.ejs.jts.jts.CurrentImpl.commit(CurrentImpl.java:200) at com.ibm.ejs.jts.jts.CurrentSet.commit(CurrentSet.java:256) at com.ibm.ejs.jts.jts.Current.commit(Current.java:71) at com.ibm.ejs.jts.jta.UserTransactionImpl.commit(UserTransactionImpl.java:182) at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:532) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:373) at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:241) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:66) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152)

    Spring JIRA | 1 decade ago | Victor
    java.lang.IllegalStateException: Active Spring transaction synchronization or jtaTransactionManager on LocalSessionFactoryBean plus active JTA transaction required
  2. 0

    In the afterPropertiesSet call of LocalSessionFactoryBean, the configTimeTransactionManagerHolder is set after mappingLocations, which is incorrect because mappingLocations will incur hibernate type mapping and the LobType will initialized with "null" jtaManager instance, and later cause the attached error. Moving the if (this.jtaTransactionManager != null) { // set Spring-provided JTA TransactionManager for Hibernate cache callbacks config.setProperty(Environment.TRANSACTION_MANAGER_STRATEGY, LocalTransactionManagerLookup.class.getName()); configTimeTransactionManagerHolder.set(this.jtaTransactionManager); } to the top of afterPropertiesSet will fix this bug. =================== [9/8/04 14:39:11:047 EDT] 7e2ed625 SystemOut U ERROR [ORB.thread.pool:1] (SessionFactoryUtils.java:743) - beforeCommit callback threw exception java.lang.IllegalStateException: Active Spring transaction synchronization or jtaTransactionManager on LocalSessionFactoryBean plus active JTA transaction required at org.springframework.orm.hibernate.support.AbstractLobType.nullSafeSet(AbstractLobType.java:169) at net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118) at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:393) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442) at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236) at org.springframework.orm.hibernate.SessionFactoryUtils$SpringSessionSynchronization.beforeCommit(SessionFactoryUtils.java:655) at org.springframework.orm.hibernate.SessionFactoryUtils$JtaSessionSynchronization.beforeCompletion(SessionFactoryUtils.java:740) at com.ibm.ejs.jts.jta.TransactionImpl.before_completion(TransactionImpl.java:966) at com.ibm.ejs.jts.jts.CoordinatorImpl$Sync.beforePrepare(CoordinatorImpl.java:692) at com.ibm.ejs.jts.tran.EventCallback.executeCallback(EventCallback.java:166) at com.ibm.ejs.jts.tran.EventCallback.executeCallbackTree(EventCallback.java:132) at com.ibm.ejs.jts.tran.EventPrepare.ExecuteBeforePrepareCallbacks(EventPrepare.java:297) at com.ibm.ejs.jts.tran.EventPrepare.event_LocalPrepareWork(EventPrepare.java:277) at com.ibm.ejs.jts.tran.EventPrepare.event_BecomeCoordinator(EventPrepare.java:960) at com.ibm.ejs.jts.tran.EventControl.event_EndTopLevel(EventControl.java:295) at com.ibm.ejs.jts.tran.TrecInterface.end(TrecInterface.java:88) at com.ibm.ejs.jts.jts.TerminatorImpl.commit(TerminatorImpl.java:89) at com.ibm.ejs.jts.jts.CurrentImpl.commit(CurrentImpl.java:200) at com.ibm.ejs.jts.jts.CurrentSet.commit(CurrentSet.java:256) at com.ibm.ejs.jts.jts.Current.commit(Current.java:71) at com.ibm.ejs.jts.jta.UserTransactionImpl.commit(UserTransactionImpl.java:182) at org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:532) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:373) at org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:241) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:66) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152)

    Spring JIRA | 1 decade ago | Victor
    java.lang.IllegalStateException: Active Spring transaction synchronization or jtaTransactionManager on LocalSessionFactoryBean plus active JTA transaction required
  3. 0

    Active Spring transaction synchronization or active JTA

    co.uk | 5 months ago
    java.lang.IllegalStateException: Active Spring transaction synchronization or active JTA transaction with specified [javax.transaction.TransactionManager] required
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Spring @scheduled method not invoked via proxy therefore no transaction

    Stack Overflow | 10 months ago | mbosecke
    java.lang.IllegalStateException: Transaction synchronization is not active
  6. 0

    Cause: java.lang.IllegalStateException: ClobStringType requires active transaction synchronization Stack Trace: [hide] java.lang.IllegalStateException: ClobStringType requires active transaction synchronization at com.atlassian.confluence.util.ConfluenceClobStringType.nullSafeSet(ConfluenceClobStringType.java:51) at net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118) at net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:393) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466) at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442) at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29) at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2382) at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2335) at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2204) at bucket.custom.FlushingSpringSessionInViewFilter.closeSession(FlushingSpringSessionInViewFilter.java:39) at org.springframework.orm.hibernate.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:122) ... Request Information: Request URL: http://app2.labs.intellij.net:8080/confluence/users/doeditmyprofile.action - Scheme: http - Server: app2.labs.intellij.net - Port: 8080 - URI: /confluence/500page.jsp - - Context Path: /confluence - - Servlet Path: /500page.jsp - - Path Info: null - - Query String: null Request Attributes: - javax.servlet.forward.request_uri : /confluence/users/doeditmyprofile.action - javax.servlet.forward.context_path : /confluence - javax.servlet.forward.servlet_path : /users/doeditmyprofile.action - javax.servlet.forward.path_info : /500page.jsp - com.atlassian.confluence.setup.SpringSessionInViewFilter.sessionFactory : true - javax.servlet.error.exception : java.lang.IllegalStateException: ClobStringType requires active transaction synchronization - javax.servlet.error.message : - os_securityfilter_already_filtered : true - com.atlassian.johnson.filters.JohnsonFilter_already_filtered : true - javax.servlet.error.request_uri : /confluence/users/doeditmyprofile.action - javax.servlet.error.status_code : 500 - __sitemesh__filterapplied : true - javax.servlet.error.servlet_name : action - webwork.valueStack : com.opensymphony.xwork.util.OgnlValueStack@1f250e8 - loginfilter.already.filtered : true - atlassian.core.seraph.original.url : /users/doeditmyprofile.action - javax.servlet.jsp.jspException : bucket.core.InfrastructureException: Error at parsing the configuration file: Error at (5, 82: No ClassLoaders found for: bucket.search.lucene.LuceneConfiguration$LuceneMapping Request Logging: 0 log statements generated by this request:

    Atlassian JIRA | 1 decade ago | Sergey Zhukov
    java.lang.IllegalStateException: ClobStringType requires active transaction synchronization

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.IllegalStateException

      Active Spring transaction synchronization or jtaTransactionManager on LocalSessionFactoryBean plus active JTA transaction required

      at org.springframework.orm.hibernate.support.AbstractLobType.nullSafeSet()
    2. Hibernate
      AbstractLobType.nullSafeSet
      1. org.springframework.orm.hibernate.support.AbstractLobType.nullSafeSet(AbstractLobType.java:169)
      1 frame
    3. net.sf.hibernate
      SessionImpl.flush
      1. net.sf.hibernate.type.CustomType.nullSafeSet(CustomType.java:118)
      2. net.sf.hibernate.persister.EntityPersister.dehydrate(EntityPersister.java:393)
      3. net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:466)
      4. net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
      5. net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
      6. net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2414)
      7. net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2367)
      8. net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2236)
      8 frames
    4. Hibernate
      SessionFactoryUtils$JtaSessionSynchronization.beforeCompletion
      1. org.springframework.orm.hibernate.SessionFactoryUtils$SpringSessionSynchronization.beforeCommit(SessionFactoryUtils.java:655)
      2. org.springframework.orm.hibernate.SessionFactoryUtils$JtaSessionSynchronization.beforeCompletion(SessionFactoryUtils.java:740)
      2 frames
    5. com.ibm.ejs
      UserTransactionImpl.commit
      1. com.ibm.ejs.jts.jta.TransactionImpl.before_completion(TransactionImpl.java:966)
      2. com.ibm.ejs.jts.jts.CoordinatorImpl$Sync.beforePrepare(CoordinatorImpl.java:692)
      3. com.ibm.ejs.jts.tran.EventCallback.executeCallback(EventCallback.java:166)
      4. com.ibm.ejs.jts.tran.EventCallback.executeCallbackTree(EventCallback.java:132)
      5. com.ibm.ejs.jts.tran.EventPrepare.ExecuteBeforePrepareCallbacks(EventPrepare.java:297)
      6. com.ibm.ejs.jts.tran.EventPrepare.event_LocalPrepareWork(EventPrepare.java:277)
      7. com.ibm.ejs.jts.tran.EventPrepare.event_BecomeCoordinator(EventPrepare.java:960)
      8. com.ibm.ejs.jts.tran.EventControl.event_EndTopLevel(EventControl.java:295)
      9. com.ibm.ejs.jts.tran.TrecInterface.end(TrecInterface.java:88)
      10. com.ibm.ejs.jts.jts.TerminatorImpl.commit(TerminatorImpl.java:89)
      11. com.ibm.ejs.jts.jts.CurrentImpl.commit(CurrentImpl.java:200)
      12. com.ibm.ejs.jts.jts.CurrentSet.commit(CurrentSet.java:256)
      13. com.ibm.ejs.jts.jts.Current.commit(Current.java:71)
      14. com.ibm.ejs.jts.jta.UserTransactionImpl.commit(UserTransactionImpl.java:182)
      14 frames
    6. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.jta.JtaTransactionManager.doCommit(JtaTransactionManager.java:532)
      2. org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:373)
      3. org.springframework.transaction.interceptor.TransactionAspectSupport.doCommitTransactionAfterReturning(TransactionAspectSupport.java:241)
      4. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:66)
      4 frames
    7. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:138)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:152)
      2 frames