各位大哥帮我看看是哪里是出了问题!

06-03-01 leafdly
环境:tomcat+mysql

常常是报下列一个错误~

** END NESTED EXCEPTION **

Attempted reconnect 3 times. Giving up.

SQLException: Server connection failure during transaction. Due to underlying exception: 'java.sql.SQLException: Data source rejected establishment of connection, message from server: "Too many connections"'.

** BEGIN NESTED EXCEPTION **

java.sql.SQLException

MESSAGE: Data source rejected establishment of connection, message from server: "Too many connections"

STACKTRACE:

java.sql.SQLException: Data source rejected establishment of connection, message from server: "Too many connections"

at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:650)

at com.mysql.jdbc.Connection.createNewIO(Connection.java:1926)

at com.mysql.jdbc.Connection.<init>(Connection.java:452)

at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:411)

at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)

at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)

at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)

at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)

at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)

at com.netluck.dateBase.DbTemp.queryMultiObject(DbTemp.java:125)

at com.netluck.down.typeBean.getDTelTypeList(typeBean.java:130)

at org.apache.jsp.top_jsp._jspService(top_jsp.java:269)

at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)

at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)

at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)

at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)

at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:300)

at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:374)

at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:743)

at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:675)

at org.apache.jk.common.SocketConnection.runIt(ChannelSocket.java:866)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)

at java.lang.Thread.run(Thread.java:534)

是应该是数据库的链接数已达到最大限制,是不是得在tomcat的server.xml文件配置中的maxIdle和maxWait的值有关,这两个值应该设值为多少好~服务器的日访问量大概在30000左右。

请banq老师和其他各位高手帮帮忙!

1
banq
2006-03-02 14:12
>Data source rejected establishment of connection, message from server: "Too many connections"'.

太多数据库连接,可能持续打开(因为速度慢)没有关闭,你的系统需要使用性能提升,建议你使用Jdon框架重构一下。

leafdly
2006-03-02 16:34
呵呵~jdon框架正在学习中~!

这个问题已经解决了,是mysql的max connections设置的问题

猜你喜欢