日期:2014-05-16  浏览次数:20463 次

程序访问数据库时出现不能连接的问题

?每天第一次访问mysql数据库时都会出现下面这样的问题,每天凌晨我都用mysqldump做了数据库的备份,不知道是不是这个引起的,该怎么办呢?

HTTP Status 500 -


type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: Cannot close connection
	org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)
	org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:423)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	com.kt.ecard.jolly.util.LoginValidateFilter.doFilter(LoginValidateFilter.java:64)
	com.kt.ecard.wuyf.util.filter.CharacterFilter.doFilter(CharacterFilter.java:73)

?

root cause

org.hibernate.exception.GenericJDBCException: Cannot close connection
	org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:91)
	org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:79)
	org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
	org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
	org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:347)
	org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:298)
	org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:187)
	org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:213)
	org.hibernate.jdbc.JDBCContext.connectionCleanedUp(JDBCContext.java:100)
	org.hibernate.jdbc.ConnectionManager.cleanup(ConnectionManager.java:286)
	org.hibernate.jdbc.ConnectionManager.close(ConnectionManager.java:218)
	org.hibernate.impl.SessionImpl.close(SessionImpl.java:317)
	com.kt.ecard.jolly.dao.utils.HiberManager.closeSession(HiberManager.java:66)
	com.kt.ecard.jolly.util.biz.BusinessHandle.invoke(BusinessHandle.java:134)
	$Proxy0.logon(Unknown Source)
	com.kt.ecard.wuyf.usermanagement.action.UserAction.logon(UserAction.java:125)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:585)
	org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:276)
	org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:196)
	org.apache.struts.actions.MappingDispatchAction.execute(MappingDispatchAction.java:171)
	org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
	org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
	org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
	org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
	com.kt.ecard.jolly.util.LoginValidateFilter.doFilter(LoginValidateFilter.java:64)
	com.kt.ecard.wuyf.util.filter.CharacterFilter.doFilter(CharacterFilter.java:73)