JAVA日志

JAVA日志

 

请大家帮忙 关于异常:org.springframework.transaction.TransactionSystemException

最近在项目中间遇到一个棘手的问题,希望有经验的朋友能帮帮小弟,感激不尽。
具体问题是:在工程部署到tomcat,然后启动tamcat,登录工程,无任何问题,但是问题出在大概一个小时以后,重新访问工程,登录时抛出如下异常:

 1Exception Type: org.springframework.transaction.TransactionSystemException 
 2
 3网络正忙,请稍候再试!(RT) (Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed)
 4 
 5org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed
 6org.hibernate.TransactionException: JDBC rollback failed
 7    at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:170)
 8    at org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:603)
 9    at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:583)
10    at org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:560)
11    at org.springframework.transaction.interceptor.TransactionAspectSupport.doCloseTransactionAfterThrowing(TransactionAspectSupport.java:284)
12    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:100)
13    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
14    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
15    at $Proxy13.adminLogin(Unknown Source)
16    at com.imart.web.servlet.AdminLoginServlet.onLogin(AdminLoginServlet.java:56)
17    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
18    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
19    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
20    at java.lang.reflect.Method.invoke(Method.java:585)
21    at com.imart.web.core.servlet.AbstractServlet.invokeMethodDispatcher(AbstractServlet.java:298)
22    at com.imart.web.core.servlet.AbstractServlet.doGet(AbstractServlet.java:210)
23    at com.imart.web.core.servlet.AbstractServlet.doPost(AbstractServlet.java:614)
24    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
25    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
26    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
27    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
28    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
29    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
30    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
31    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
32    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
33    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
34    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
35    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
36    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
37    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
38    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
39    at java.lang.Thread.run(Thread.java:595)
40Caused by: java.sql.SQLException: Couldn't perform the operation rollback: You can't perform any operations on this connection. It has been automatically closed by Proxool for some reason (see logs).
41    at org.logicalcobwebs.proxool.WrappedConnection.invoke(WrappedConnection.java:207)
42    at org.logicalcobwebs.proxool.WrappedConnection.intercept(WrappedConnection.java:87)
43    at oracle.jdbc.internal.ClientDataSupport$$EnhancerByCGLIB$$772388fb.rollback()
44    at org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:183)
45    at org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:162)
46     32 more
47 
48
不知这是否和spring的事务管理器配置有关
配置如下:
  1<bean id="dataSource"
  2        class="org.logicalcobwebs.proxool.ProxoolDataSource">
  3        <property name="driver">
  4            <value>${jdbc.driver}</value>
  5        </property>
  6        <property name="driverUrl">
  7            <value>${jdbc.url}</value>
  8        </property>
  9        <property name="user">
 10            <value>${jdbc.username}</value>
 11        </property>
 12        <property name="password">
 13            <value>${jdbc.password}</value>
 14        </property>
 15        <property name="alias">
 16            <value>${proxool.alias}</value>
 17        </property>
 18        <property name="houseKeepingSleepTime">
 19            <value>${proxool.houseKeepingSleepTime}</value>
 20        </property>
 21        <property name="minimumConnectionCount">
 22            <value>${proxool.minimumConnectionCount}</value>
 23        </property>
 24        <property name="maximumConnectionCount">
 25            <value>${proxool.maximumConnectionCount}</value>
 26        </property>
 27        <property name="prototypeCount">
 28            <value>${proxool.prototypeCount}</value>
 29        </property>
 30        <property name="trace">
 31            <value>${proxool.trace}</value>
 32        </property>
 33        <property name="verbose">
 34            <value>${proxool.verbose}</value>
 35        </property>
 36    </bean>
 37
 38
 39    <!-- Hibernate, ORM and common Interceptors -->
 40    <bean id="sessionFactory"
 41        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
 42        <property name="configurationClass">
 43            <value>org.hibernate.cfg.AnnotationConfiguration</value>
 44        </property>
 45        <property name="configLocation">
 46            <value>/WEB-INF/${hibernate.cfg}</value>
 47        </property>
 48        <property name="hibernateProperties">
 49            <props>
 50                <prop key="hibernate.dialect">
 51                    ${hibernate.dialect}
 52                </prop>
 53                <prop key="hibernate.show_sql">${jdbc.showsql}</prop>
 54                <prop key="hibernate.use_outer_join">true</prop>
 55                <prop key="hibernate.format_sql">
 56                    ${jdbc.formate_sql}
 57                </prop>
 58                <prop key="hibernate.jdbc.batch_size">15</prop>
 59                <prop key="hibernate.jdbc.fetch_size">5</prop>
 60                <prop key="hibernate.default_batch_fetch_size">8</prop>
 61                <prop key="hibernate.connection.release_mode">
 62                    auto
 63                </prop>
 64            </props>
 65        </property>
 66        <property name="dataSource">
 67            <ref bean="dataSource" />
 68        </property>
 69
 70    </bean>
 71
 72
 73    <bean id="hibernateInterceptor"
 74        class="org.springframework.orm.hibernate3.HibernateInterceptor">
 75        <property name="sessionFactory">
 76            <ref bean="sessionFactory" />
 77        </property>
 78    </bean>
 79
 80    <bean id="transactionInterceptor"
 81        class="org.springframework.transaction.interceptor.TransactionInterceptor">
 82        <property name="transactionManager">
 83            <ref bean="transactionManager" />
 84        </property>
 85        <property name="transactionAttributeSource">
 86            <bean
 87                class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource" />
 88        </property>
 89    </bean>
 90
 91    <bean id="transactionManager"
 92        class="org.springframework.orm.hibernate3.HibernateTransactionManager">
 93        <property name="sessionFactory">
 94            <ref local="sessionFactory"></ref>
 95        </property>
 96    </bean>
 97
 98    <bean id="abstractTxDefinition"
 99        class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean"
100        lazy-init="true">
101        <property name="transactionManager">
102            <ref bean="transactionManager" />
103        </property>
104        <property name="transactionAttributeSource">
105            <bean
106                class="org.springframework.transaction.annotation.AnnotationTransactionAttributeSource">
107            </bean>
108        </property>
109    </bean>
110
111
112    <!-- DAO -->
113    <bean id="adminDAO" class="com.imart.model.dao.AdminDAO">
114        <property name="sessionFactory">
115            <ref bean="sessionFactory" />
116        </property>
117    </bean>
118
119
120    <bean id="adminService" parent="abstractTxDefinition">
121        <property name="proxyInterfaces">
122            <value>com.imart.model.service.AdminService</value>
123        </property>
124        <property name="target">
125            <bean class="com.imart.model.service.spi.AdminServiceImpl"
126                init-method="init">
127            </bean>
128        </property>
129    </bean>

proxool配置如下
#proxool setting
proxool.alias
=imart-sim
proxool.houseKeepingSleepTime
=30000
proxool.minimumConnectionCount
=5
proxool.maximumConnectionCount
=1000
proxool.prototypeCount
=5
proxool.trace
=false
proxool.verbose
=false
proxool.maximumActiveTime
=300000
proxool.maximumConnectionLifetime
=3060000000

posted on 2007-12-15 11:54 小木 阅读(19204) 评论(4)  编辑  收藏

评论

# re: 请大家帮忙 关于异常:org.springframework.transaction.TransactionSystemException 2008-04-11 16:37 liutr

怎么解决的呀,,我也碰到了同样的问题!!  回复  更多评论   

# re: ���Ұ�æ �����쳣��org.springframework.transaction.TransactionSystemException 2008-08-01 08:59 xuej

怎么解决的呀,,我也碰到了同样的问题!!   回复  更多评论   

# re: 请大家帮忙 关于异常:org.springframework.transaction.TransactionSystemException 2008-12-08 10:42 wrong1111

最近也碰到楼主的问题,正头疼。。不知道楼主是怎么解决的??
或者楼主有好的解决方法请 email :wrong1111@126.com
或msn: woshixiaowangyong@163.com  回复  更多评论   

# re: 请大家帮忙 关于异常:org.springframework.transaction.TransactionSystemException [未登录] 2013-04-26 11:31 simon

查询语句出错,或者是查询参数有问题,导致超时,导致spring报上述错误。  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航:
 

导航

统计

常用链接

留言簿(1)

随笔档案

相册

搜索

最新评论

阅读排行榜

评论排行榜