aspose file tools*
The moose likes Spring and the fly likes Already value for key bound to thread exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Already value for key bound to thread exception" Watch "Already value for key bound to thread exception" New topic
Author

Already value for key bound to thread exception

Ponnusamy Gov
Greenhorn

Joined: Feb 01, 2011
Posts: 17


Dear All,

Our web application built in struts 1.1, Hibernate3 and Spring framework technologies and it is running in tomcat application server version 6. Web server is Apache version 2. Till now request is directly handled by tomcat application server. Recently we have implemented the Apache web server using APJ connector protocol. Now we are getting the below error and we are unable to simulate the same. Please provide solution for this issue if anybody face this issue earlier.

java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate3.SessionHolder@42966c] for key [org.hibernate.impl.SessionFactoryImpl@395573] bound to thread [TP-Processor2]


Thanks in advance,

Pons.
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1666
    
    7

Well that is not a full stack trace, nor enough information to really help you. What does your transaction configuration look like? Here was someone with a similar problem do to proxying the session factory. I don't know enough detail to know if it applies to you or not.

http://forum.springsource.org/showthread.php?103214-Transactions-not-reentrant


[How To Ask Questions][Read before you PM me]
Ponnusamy Gov
Greenhorn

Joined: Feb 01, 2011
Posts: 17
Hi Bill,

Sorry for the incomplete trace. Please find the full log trace:
2013-01-30 21:01:00,798[user1]ERROR[com.test.FilterDispatcher:?] Exception in doFilter ---->
java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate3.SessionHolder@1edeb03] for key [org.hibernate.impl.SessionFactoryImpl@1cd7e2c] bound to thread [TP-Processor10]
at org.springframework.transaction.support.TransactionSynchronizationManager.bindResource(TransactionSynchronizationManager.java:163)
at com.test.FilterDispatcher.callFilter(FilterDispatcher.java)
at com.test.FilterDispatcher.doFilter(FilterDispatcher.java)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:227)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
2013-01-30 21:01:00,798[user1]WARN [com.test.FilterDispatcher:?] Unable to rollback transaction
java.lang.NullPointerException
at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:724)
at com.test.FilterDispatcher.callFilter(FilterDispatcher.java)
at com.test.FilterDispatcher.doFilter(FilterDispatcher.java)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:183)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:138)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)
at org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:227)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Bill Gorder
Bartender

Joined: Mar 07, 2010
Posts: 1666
    
    7

It looks like you have a null pointer exception. I would set some break points and find out what is null

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Already value for key bound to thread exception