Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hibernate Exception: Pre-bound JDBC Connection found

I have the following problem:

In a multi user spring hibernate web application we encounter the following exception. When checking the logging it happens at multiple places. I googled around, also checked Stackoverflow, but I can't find a solution:

Pre-bound JDBC Connection found! HibernateTransactionManager does not support running within DataSourceTransactionManager if told to manage the DataSource itself. It is recommended to use a single HibernateTransactionManager for all transactions on a single DataSource, no matter whether Hibernate or JDBC access.

I read it might be a configuraton problem, but I don't see what's wrong so I'll include the hibernate configuration:

<!-- pooled datasource -->
<bean id="dataSource" class="org.apache.commons.dbcp.PoolingDataSource" depends-on="poolableConnectionFactory">
    <constructor-arg>
        <ref bean="pool"/>
    </constructor-arg>
</bean>

<bean id="ds" class="com.ibm.db2.jcc.DB2SimpleDataSource">
    <property name="serverName">
        <value>xxx.xxx.xxx.xxx</value>
    </property>
    <property name="databaseName">
        <value>xxx</value>
    </property>
    <property name="portNumber">
        <value>50000</value>
    </property>
    <property name="user">
        <value>xxx</value>
    </property>
    <property name="password">
        <value>xxx</value>
    </property>
    <property name="driverType">
        <value>4</value>
    </property>
    <property name="allowNextOnExhaustedResultSet">
        <value>1</value>
    </property>
    <property name="deferPrepares">
        <value>false</value>
    </property>
</bean>

<bean id="pool" class="org.apache.commons.pool.impl.GenericObjectPool">
    <property name="minIdle">
        <value>5</value>
    </property>
    <property name="maxActive">
        <value>50</value>
    </property>
    <property name="minEvictableIdleTimeMillis">
        <value>90000</value>
    </property>
    <property name="timeBetweenEvictionRunsMillis">
        <value>30000</value>
    </property>
</bean>

<bean id="dsConnectionFactory" class="org.apache.commons.dbcp.DataSourceConnectionFactory">
    <constructor-arg index="0">
        <ref bean="ds"/>
    </constructor-arg>
</bean>

<bean id="poolableConnectionFactory" class="org.apache.commons.dbcp.PoolableConnectionFactory">
    <constructor-arg index="0"><ref bean="dsConnectionFactory"/></constructor-arg>
    <constructor-arg index="1"><ref bean="pool"/></constructor-arg>
    <constructor-arg index="2"><null/></constructor-arg>
    <constructor-arg index="3"><value>SELECT 1 FROM SYSIBM.SYSDUMMY1</value></constructor-arg>
    <constructor-arg index="4"><value>false</value></constructor-arg>
    <constructor-arg index="5"><value>true</value></constructor-arg>
</bean>

<bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    <property name="mappingLocations">
        <list>
            <value>classpath:aaa/bbb/Ccc.hbm.xml</value>
            <value>classpath:aaa/bbb/Cdd.hbm.xml</value>
            <value>classpath:aaa/bbb/Eee.hbm.xml</value>                
        </list>
    </property>
    <property name="annotatedClasses">
        <list>
           <value>aaa.bbb.Fff</value>
           <value>aaa.bbb.Ggg</value>   
           <value>aaa.bbb.Hhh</value>
        </list>
   </property>
    <property name="hibernateProperties">
        <props>
            <prop key="hibernate.dialect">be.camco.po.persistency.hibernate.dialect.MyCustomDialect</prop>
            <prop key="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</prop>
            <prop key="hibernate.cache.use_query_cache">true</prop>
            <prop key="hibernate.default_batch_fetch_size">20</prop>
            <prop key="hibernate.show_sql">false</prop>
        </props>
    </property>
    <property name="dataSource">
        <ref bean="dataSource"/>
    </property>
</bean>

<!-- open session in view -->
<bean name="openSessionInViewInterceptor" class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor">
    <property name="sessionFactory">
        <ref bean="hibernateSessionFactory"/>
    </property>
    <!-- flush auto =1, 0 = never-->
    <property name="flushMode">
        <value>1</value>
    </property>
</bean>

<!-- Transaction manager for a single Hibernate SessionFactory (alternative to JTA) -->
<bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory">
        <ref local="hibernateSessionFactory"/>
    </property>
</bean>

For those who wonder what hibernate verion is being used; on deployment the following shows up in the log:

[Version] Hibernate Annotations 3.2.1.GA

INFO org.hibernate.cfg.Environment - Hibernate 3.3.1.GA

Spring 3.2.4 is being used and spring security 3.1.4

Here is a stacktrace. The exception does occur on several occasions; I can't reproduce the exception; it seems to just happen sometime. In the stacktrace I included logging from before the exception with "Pre-bound JDBC Connection...", but I do not know if they are related:

> 2015-07-23 14:53:45,734 ERROR [org.springframework.transaction.support.TransactionSynchronizationUtils] TransactionSynchronization.afterCompletion threw exception
java.util.ConcurrentModificationException
    at java.util.LinkedHashMap$LinkedHashIterator.nextEntry(Unknown Source)
    at java.util.LinkedHashMap$ValueIterator.next(Unknown Source)
    at org.hibernate.engine.StatefulPersistenceContext.afterTransactionCompletion(StatefulPersistenceContext.java:253)
    at org.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:450)
    at org.springframework.orm.hibernate3.SpringSessionSynchronization.afterCompletion(SpringSessionSynchronization.java:199)
    ...
2015-07-23 14:53:45,736 ERROR [STDERR] org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate3.SessionHolder@4acab4eb] for key [org.hibernate.impl.SessionFactoryImpl@6c164690] bound to thread [http-10.249.0.32-443-4]
2015-07-23 14:53:45,736 ERROR [STDERR]  at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:541)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
2015-07-23 14:53:45,737 ERROR [STDERR]  at be.camco.po.BusinessFacade$$EnhancerByCGLIB$$100126ee.toJSON(<generated>)
2015-07-23 14:53:45,737 ERROR [STDERR]  at be.camco.po.web.controller.ShipmentController.toListView(ShipmentController.java:200)
2015-07-23 14:53:45,737 ERROR [STDERR]  at sun.reflect.GeneratedMethodAccessor829.invoke(Unknown Source)
2015-07-23 14:53:45,737 ERROR [STDERR]  at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
2015-07-23 14:53:45,737 ERROR [STDERR]  at java.lang.reflect.Method.invoke(Unknown Source)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
2015-07-23 14:53:45,737 ERROR [STDERR]  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
2015-07-23 14:53:45,738 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
2015-07-23 14:53:45,738 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-07-23 14:53:45,738 ERROR [STDERR]  at be.camco.po.web.filter.MenuFilter.doFilter(MenuFilter.java:28)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
2015-07-23 14:53:45,738 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
2015-07-23 14:53:45,739 ERROR [STDERR]  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
2015-07-23 14:53:45,739 ERROR [STDERR]  at java.lang.Thread.run(Unknown Source)
2015-07-23 14:53:45,740 ERROR [STDERR] Caused by: java.lang.IllegalStateException: Already value [org.springframework.orm.hibernate3.SessionHolder@4acab4eb] for key [org.hibernate.impl.SessionFactoryImpl@6c164690] bound to thread [http-10.249.0.32-443-4]
2015-07-23 14:53:45,740 ERROR [STDERR]  at org.springframework.transaction.support.TransactionSynchronizationManager.bindResource(TransactionSynchronizationManager.java:189)
2015-07-23 14:53:45,740 ERROR [STDERR]  at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:532)
2015-07-23 14:53:45,740 ERROR [STDERR]  ... 65 more
2015-07-23 14:56:20,645 ERROR [STDERR] org.springframework.transaction.IllegalTransactionStateException: Pre-bound JDBC Connection found! HibernateTransactionManager does not support running within DataSourceTransactionManager if told to manage the DataSource itself. It is recommended to use a single HibernateTransactionManager for all transactions on a single DataSource, no matter whether Hibernate or JDBC access.
2015-07-23 14:56:20,646 ERROR [STDERR]  at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:427)
2015-07-23 14:56:20,646 ERROR [STDERR]  at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372)
2015-07-23 14:56:20,646 ERROR [STDERR]  at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417)
2015-07-23 14:56:20,646 ERROR [STDERR]  at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255)
2015-07-23 14:56:20,647 ERROR [STDERR]  at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
2015-07-23 14:56:20,647 ERROR [STDERR]  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
2015-07-23 14:56:20,647 ERROR [STDERR]  at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)
2015-07-23 14:56:20,647 ERROR [STDERR]  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
2015-07-23 14:56:20,647 ERROR [STDERR]  at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)
2015-07-23 14:56:20,648 ERROR [STDERR]  at be.camco.po.BusinessFacade$$EnhancerByCGLIB$$100126ee.findProductByCode(<generated>)
2015-07-23 14:56:20,648 ERROR [STDERR]  at be.camco.po.web.controller.ProductController.formBackingObject(ProductController.java:616)
2015-07-23 14:56:20,648 ERROR [STDERR]  at org.springframework.web.servlet.mvc.AbstractFormController.getErrorsForNewForm(AbstractFormController.java:361)
2015-07-23 14:56:20,648 ERROR [STDERR]  at org.springframework.web.servlet.mvc.AbstractFormController.showNewForm(AbstractFormController.java:341)
2015-07-23 14:56:20,648 ERROR [STDERR]  at org.springframework.web.servlet.mvc.AbstractFormController.handleRequestInternal(AbstractFormController.java:281)
2015-07-23 14:56:20,648 ERROR [STDERR]  at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
2015-07-23 14:56:20,648 ERROR [STDERR]  at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
2015-07-23 14:56:20,648 ERROR [STDERR]  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:925)
2015-07-23 14:56:20,649 ERROR [STDERR]  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856)
2015-07-23 14:56:20,649 ERROR [STDERR]  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:936)
2015-07-23 14:56:20,649 ERROR [STDERR]  at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:827)
2015-07-23 14:56:20,649 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
2015-07-23 14:56:20,649 ERROR [STDERR]  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:812)
2015-07-23 14:56:20,649 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
2015-07-23 14:56:20,649 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
2015-07-23 14:56:20,649 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-07-23 14:56:20,649 ERROR [STDERR]  at be.camco.po.web.filter.MenuFilter.doFilter(MenuFilter.java:28)
2015-07-23 14:56:20,649 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)
2015-07-23 14:56:20,650 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:183)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:343)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:260)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
2015-07-23 14:56:20,651 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
2015-07-23 14:56:20,652 ERROR [STDERR]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
2015-07-23 14:56:20,653 ERROR [STDERR]  at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
2015-07-23 14:56:20,653 ERROR [STDERR]  at java.lang.Thread.run(Unknown Source)
like image 290
Tom Avatar asked Aug 05 '15 08:08

Tom


1 Answers

I consider your code is not complete to solve your issue uniquely: there is no implied relation between pool and poolableConnectionFactory, not matching line numbers for spring version 3.2.4 (eg. HibernateTransactionManager.java at line 532 doesn't have the call to TransactionSynchronizationManager.bindResource() and so on).

I didn't find <tx:annotation-driven/> declaration in your config. And you use annotation driven transaction in ProductController.formBackingObject() method.

So my guess is your case is described here.

EDIT: HibernateTransactionManager calls bindResource() at line 532 in spring version 2.0.8. As you pointed in comment application class path contains spring-hibernate3-2.0.8.jar, but spring-orm-3.2.4.jar should be used instead.

like image 119
svaor Avatar answered Oct 18 '22 03:10

svaor