mysql5.0+tomcat6.0
exception javax.servlet.ServletException: org.springframework.dao.DataAccessResourceFailureException: could not execute query; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute query org.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) com.chou4.filter.DecodeFilter.doFilter(DecodeFilter.java:23)
root cause org.springframework.dao.DataAccessResourceFailureException: could not execute query; nested exception is org.hibernate.exception.JDBCConnectionException: could not execute query org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:612) org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412) org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:424) org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343) com.chou4.common.CommonImpl.nameQueryPojo(CommonImpl.java:134) com.aptech.dao.impl.AdministratorsDaoImpl.login(AdministratorsDaoImpl.java:51) com.aptech.dao.service.impl.GrantServiceImpl.login(GrantServiceImpl.java:222) com.chou4.action.admin.LoginAction.execute(LoginAction.java:53) 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) com.chou4.filter.DecodeFilter.doFilter(DecodeFilter.java:23)
root cause org.hibernate.exception.JDBCConnectionException: could not execute query org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74) org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43) org.hibernate.loader.Loader.doList(Loader.java:2223) org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) org.hibernate.loader.Loader.list(Loader.java:2099) org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378) org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) com.chou4.common.CommonImpl$1.doInHibernate(CommonImpl.java:57) org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419) org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343) com.chou4.common.CommonImpl.nameQueryPojo(CommonImpl.java:134) com.aptech.dao.impl.AdministratorsDaoImpl.login(AdministratorsDaoImpl.java:51) com.aptech.dao.service.impl.GrantServiceImpl.login(GrantServiceImpl.java:222) com.chou4.action.admin.LoginAction.execute(LoginAction.java:53) 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) com.chou4.filter.DecodeFilter.doFilter(DecodeFilter.java:23)
root cause java.sql.SQLException: No operations allowed after connection closed. com.mysql.jdbc.Connection.checkClosed(Connection.java:2647) com.mysql.jdbc.Connection.prepareStatement(Connection.java:1303) com.mysql.jdbc.Connection.prepareStatement(Connection.java:1284) org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:505) org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:423) org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139) org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1547) org.hibernate.loader.Loader.doQuery(Loader.java:673) org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236) org.hibernate.loader.Loader.doList(Loader.java:2220) org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104) org.hibernate.loader.Loader.list(Loader.java:2099) org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378) org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338) org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172) org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121) org.hibernate.impl.QueryImpl.list(QueryImpl.java:79) com.chou4.common.CommonImpl$1.doInHibernate(CommonImpl.java:57) org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:419) org.springframework.orm.hibernate3.HibernateTemplate.executeFind(HibernateTemplate.java:343) com.chou4.common.CommonImpl.nameQueryPojo(CommonImpl.java:134) com.aptech.dao.impl.AdministratorsDaoImpl.login(AdministratorsDaoImpl.java:51) com.aptech.dao.service.impl.GrantServiceImpl.login(GrantServiceImpl.java:222) com.chou4.action.admin.LoginAction.execute(LoginAction.java:53) 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) com.chou4.filter.DecodeFilter.doFilter(DecodeFilter.java:23)
--转自