最近在项目中间遇到一个棘手的问题,希望有经验的朋友能,。
具体问题是:在工程部署到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
分享到:
相关推荐
org.springframework.transaction-3.0.4.RELEASE.jar org.springframework.web.portlet-3.0.4.RELEASE.jar org.springframework.web.servlet-3.0.4.RELEASE.jar org.springframework.web.struts-3.0.4.RELEASE....
org.springframework.transaction-3.0.5.RELEASE.jar org.springframework.web-3.0.5.RELEASE.jar org.springframework.web.portlet-3.0.5.RELEASE.jar org.springframework.web.servlet-3.0.5.RELEASE.jar org....
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionInterceptor#0': Error setting property values; nested ...
Spring中的事务管理问题:org.springframework.transaction-3.1.0.M1.jar包。org.springframework.transaction-3.1.0.M1.jar包。
org.springframework.transaction-3.2.2.RELEASE最新版本
org.springframework.transaction-3.1.RELEASE.jar org.springframework.web.portlet-3.1.RELEASE.jar org.springframework.web.servlet-3.1.RELEASE.jar org.springframework.web.struts-3.1.RELEASE.jar org....
org.springframework.transaction-3.1.1.RELEASE org.springframework.web.portlet-3.1.1.RELEASE org.springframework.web.servlet-3.1.1.RELEASE org.springframework.web.struts-3.1.1.RELEASE org.spring...
org.springframework.transaction-3.2.4.RELEASE.jar,最新版的org.springframework.transaction,Wed Aug 07 16:44:37 GMT+01:00 2013
org.springframework.transaction-3.1.0.M2
org.springframework.transaction-3.1.0.M1.jar
org.springframework.context-3.0.7.RELEASE.jar
org.springframework.transaction-3.0.0.RELEASE.jar org.springframework.web.portlet-3.0.0.RELEASE.jar org.springframework.web.servlet-3.0.0.RELEASE.jar org.springframework.web.struts-3.0.0.RELEASE.jar ...
### 关于 `org.springframework.dao.InvalidDataAccessApiUsageException` 的深入解析 在Spring与Hibernate集成开发过程中,开发者可能会遇到各种各样的异常问题。其中一种较为常见的异常是 `org.springframework....
java运行依赖jar包
org.springframework.transaction-3.0.0.M4.jar
springboot启动报错:java.lang.NoClassDefFoundError: org/springframework/transaction/ReactiveTransactionManager 不添加org.springframework.boot:spring-boot-starter-data-jpa:2.2.5.RELEASE,只有org....
org.springframework.transaction-3.0.0.RELEASE org.springframework.web.portlet-3.0.0.RELEASE org.springframework.web.servlet-3.0.0.RELEASE org.springframework.web.struts-3.0.0.RELEASE org.spring...
org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker ...
org.springframework.transaction-3.0.0.M4.jar: 为JDBC、Hibernate、JDO、JPA等提供的一致的声明式和编程式事务管理 org.springframework.web.servlet-3.0.0.M4.jar: SpringMVC org.springframework.jms-3.0.0.M4...
org.springframework.beans-3.0.0.M3.jar