java.lang.IllegalStateException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • 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)
    via by Victor,
  • 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)
    via by Victor,
    • 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)
    No Bugmate found.