`
testcs_dn
  • 浏览: 114535 次
  • 性别: Icon_minigender_1
  • 来自: 北京
文章分类
社区版块
存档分类
最新评论

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

 
阅读更多

详细错误信息:

严重: StandardWrapper.Throwable
org.springframework.transaction.CannotCreateTransactionException: Could not open JDBC Connection for transaction; nested exception is org.apache.commons.dbcp.SQLNestedException: Error preloading the connection pool
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:241)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:633)
at com.qujiu.base.service.XgPlatformManager$$EnhancerBySpringCGLIB$$112e244c.getPlarMark(<generated>)
at com.qujiu.base.web.init.BaseDataDictionary.init(BaseDataDictionary.java:40)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.apache.commons.dbcp.SQLNestedException: Error preloading the connection pool
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:868)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:203)
... 20 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1104)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2412)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2445)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2230)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
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.addObject(GenericObjectPool.java:996)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:865)
... 22 more


七月 30, 2014 12:04:20 下午 org.apache.catalina.core.StandardContext loadOnStartup
严重: Servlet /wowo-web threw load() exception
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1014)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:988)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:974)
at com.mysql.jdbc.MysqlIO.doHandshake(MysqlIO.java:1104)
at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2412)
at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2445)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2230)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:813)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:399)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:334)
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.addObject(GenericObjectPool.java:996)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:865)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:540)
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:203)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:372)
at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:417)
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:255)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:633)
at com.qujiu.base.service.XgPlatformManager$$EnhancerBySpringCGLIB$$112e244c.getPlarMark(<generated>)
at com.qujiu.base.web.init.BaseDataDictionary.init(BaseDataDictionary.java:40)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1284)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1197)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1087)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5210)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5493)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)

七月 30, 2014 12:04:20 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'springmvc'
七月 30, 2014 12:04:21 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
七月 30, 2014 12:04:21 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8009"]
七月 30, 2014 12:04:21 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 18779 ms

问题分析:

查看MySQL的当前最大连接数,登录MySQL:mysql -uroot -p,回车;输入密码,回车;

输入命令:select VARIABLE_VALUE from information_schema.GLOBAL_VARIABLES where VARIABLE_NAME='MAX_CONNECTIONS'; 回车

显示当前最大连接数为:151,之前通过文章“CentOS下mysql最大连接数设置 1040 too many connection”中的方法设置为3600了,现在怎么又变成151了?原来这个方法只是临时的修改了最大连接数,重新启动MySQL服务后就还原了。

解决问题:

要彻底解决问题还是要修改my.cnf配置文件,这里使用VI来修改,输入命令:vi /usr/my.cnf 回车;打开文件后按“i”键进入编辑状态;

在“[mysqld]”下面添加“max_connections=3600”,按Esc键进入命令模式,输入“:wq”回车(保存并退出)。

执行:service mysql restart 重新启动MySQL服务;启动服务的时间可能有点长,耐心等待……

注意:很多文章中提到在“[mysqld]”下面添加“set-variable=max_connections=1000”,根本不行,加了之后服务就启动不了了。

我这的环境是:CentOS 6.5 MySQL 5.6



分享到:
评论

相关推荐

    eclipse常见报错

    6. Mysql 的错误:Data source rejected establishment of connection message from server: "Too many connections"。 解决方法:检查 Mysql 的 max connections 设置,避免多次 insert、update 操作没有关闭 ...

    mysql &quot;too many connections&quot; 错误 之 mysql解决方法

    - 当遇到`com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Data source rejected establishment of connection, message from server: "Too many connections"`这样的异常时,说明MySQL...

    weblogic 8.X 无限制

    The Server is not licensed for this operation.Connection rejected, the server license allows connections from only 5 unique IP addresses. 没有授权 提示5个IP访问的限制 解决办法: 从licensecodes.oracle...

    mailserver开源项目

    *) Fix: Relay DATA command SMTP server response tiemout(no response from server), may cause server crash. (01.08.2011) *) New: Updated to ...

    SVN各种错误提示产生原因及处理方法大全

    2. svn: OPTIONS of 'http://svn.moon.ossxp.com/svn/test': authorization failed: Could not authenticate to server: rejected Basic challenge(http://svn.moon.ossxp.com) 该错误提示的原因是口令输入错误。...

    p29814665_122130_Generic.zip

    29870012: WLDATASOURCE.GETCONNECTIONTOINSTANCE(STRING INSTANCE) CAN FAIL IF NO CONNECTIONS TO INSTANCE HAVE BEEN PROCESSED 29448643: JAVA.IO.INVALIDCLASSEXCEPTION: FILTER STATUS: REJECTED 29312272:...

    FileZilla_3.24.0

    FileZilla是一个免费开源的FTP软件,...可控性、有条理的界面和管理多站点的简化方式使得Filezilla客户端版成为一个方便高效的FTP客户端工具,而FileZilla Server则是一个小巧并且可靠的支持FTP&SFTP;的FTP服务器软件。

    http403常见问题总结

    - **403.502 - Forbidden: Too many requests from the same client IP; Dynamic IP Restriction limit reached**:禁止:来自同一客户端 IP 的请求过多;动态 IP 限制已达到上限。 #### 三、示例分析:403.1 至 ...

    常见IIS错误,适合web编程者

    - **403.9 Too Many Users**:超过最大用户数。 - **403.10 Configuration Error**:配置错误。 - **403.11 Password Change Required**:需要更改密码。 - **403.12 Proxy Authentication Required**:需要代理...

    word自动转化为chm

    Q: Error while loading Word document: “Call was rejected by callee”, “Command failed”, “The RPC server is unavailable”, etc. A: Connection to Microsoft Word may be blocked by the anti-virus ...

    JLink_Windows_V648.zip

    DLL: Infineon TLE98xx: Some J-Link LITEs could not connect establish a successful target connection due to missing firmware functionality. Fixed. DLL: JTAG: When only having 1 TAP in the JTAG chain ...

    Senfore_DragDrop_v4.1

    The drag and drop protocols available on Linux are too much of a mess at this time. ------------------------------------------- 2. Installation: ------------------------------------------- 1) ...

    a project model for the FreeBSD Project.7z

    Ports is the collection of meta-data that is needed to make software packages build correctly on FreeBSD. An example of a port is the port for the web-browser Mozilla. It contains information about ...

    解决ElasticSearch 7.x 设置大分片的时,导入数据发生rejected 429

    在使用Elasticsearch 7.x 版本时,遇到导入大量数据到设置有大量分片(例如100个)的索引时,可能会遇到"rejected 429"错误。这个错误通常与Elasticsearch的资源管理和保护机制有关,即服务器在处理请求时达到了其...

    does not exist.解决/root/.Xauthority does not exist

    标题 "does not exist. 解决 /root/.Xauthority does not exist" 涉及到的是一个常见的 Linux 系统问题,通常在使用图形界面(如 X Window System)或通过 SSH 远程连接时遇到。这个问题指出,系统找不到 `/root/....

    解决OUTLOOK“无法发送此邮件。请在帐户属性中验证电子邮件地址 响应服务器Sender address rejected: not logged in”

    响应服务器:Sender address rejected: not logged in”。这个错误通常意味着Outlook在尝试通过SMTP服务器发送邮件时,服务器拒绝了发件人的邮箱地址,或者Outlook没有正确配置身份验证。 首先,我们需要了解电子...

    Packt.Python.for.Finance.2nd.Edition.2017

    - **Introduction to the pandas_datareader Module**: This module simplifies the process of accessing and retrieving financial market data directly from web sources. - **Two Financial Calculators**: ...

    sec常见协议及英文含义

    16. S7F1: Optional message used as a prerequisite to downloading a recipe from the host to the SuperTMX system or the tube. 英文含义:可选消息,用于从主机下载配方到SuperTMX系统或设备。 中文含义:可...

    wget-1.11.4-1

    --exclude-domains=LIST comma-separated list of rejected domains. --follow-ftp follow FTP links from HTML documents. --follow-tags=LIST comma-separated list of followed HTML tags. --ignore-tags=...

Global site tag (gtag.js) - Google Analytics