问题描述
在是在登录时候报的错:http://teapot.d113.163ns.cn/ 可以用ygl_09@126.com 密码:ygl*8912898登录在本地运行没错的。javax.servlet.ServletException: org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failedorg.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:535)org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:433)org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)javax.servlet.http.HttpServlet.service(HttpServlet.java:637)javax.servlet.http.HttpServlet.service(HttpServlet.java:717)org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)root cause org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failedorg.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:628)org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:800)org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:777)org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:339)org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)$Proxy0.login(Unknown Source)com.actions.LoginRigAction.login(LoginRigAction.java:34)sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)java.lang.reflect.Method.invoke(Method.java:597)org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)javax.servlet.http.HttpServlet.service(HttpServlet.java:637)javax.servlet.http.HttpServlet.service(HttpServlet.java:717)org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)root cause root cause org.hibernate.TransactionException: JDBC rollback failedorg.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:170)org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:625)org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:800)org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:777)org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:339)org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)$Proxy0.login(Unknown Source)com.actions.LoginRigAction.login(LoginRigAction.java:34)sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)java.lang.reflect.Method.invoke(Method.java:597)org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)javax.servlet.http.HttpServlet.service(HttpServlet.java:637)javax.servlet.http.HttpServlet.service(HttpServlet.java:717)org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)root cause com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Connection.close() has already been called. Invalid operation in this state.sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)java.lang.reflect.Constructor.newInstance(Constructor.java:513)com.mysql.jdbc.Util.handleNewInstance(Util.java:406)com.mysql.jdbc.Util.getInstance(Util.java:381)com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)com.mysql.jdbc.ConnectionImpl.getMutex(ConnectionImpl.java:3018)com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:4564)org.hibernate.transaction.JDBCTransaction.rollbackAndResetAutoCommit(JDBCTransaction.java:183)org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:162)org.springframework.orm.hibernate3.HibernateTransactionManager.doRollback(HibernateTransactionManager.java:625)org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:800)org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:777)org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:339)org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)$Proxy0.login(Unknown Source)com.actions.LoginRigAction.login(LoginRigAction.java:34)sun.reflect.GeneratedMethodAccessor19.invoke(Unknown Source)sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)java.lang.reflect.Method.invoke(Method.java:597)org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:270)org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:187)org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:110)org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)javax.servlet.http.HttpServlet.service(HttpServlet.java:637)javax.servlet.http.HttpServlet.service(HttpServlet.java:717)org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)note The full stack trace of the root cause is available in the Apache Tomcat/6.0.32 logs.
解决方案
com.actions.LoginRigAction.login(LoginRigAction.java:34) 看看你这段代码 做了什么操作导致回滚同时又因为session关闭而造成回滚失败.
解决方案二:
这类问题,可能是由于mysql的超时或什么其它设置造成的,在回滚的时候,连接已经断掉了。从这方面找找原因看看。另外看看com.actions.LoginRigAction.login(LoginRigAction.java:34) 这段代码的逻辑是不是有什么问题。
解决方案三:
引用org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed 管理好你的connection! 看看 你在什么地方关闭的!
解决方案四:
Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: JDBC rollback failed 你查看你的数据库链接啊
解决方案五:
引用com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Connection.close() has already been called. Invalid operation in this state.貌似是在数据库Connection关闭过后又调用了回滚