您尚未登录,请登录后浏览更多内容! 登录 | 立即注册

QQ登录

只需一步,快速开始

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 998|回复: 1

服务端运行一段时间出现了数据库连接异常,求帮助!!

[复制链接]

40

回帖

3

主题

80

积分

新手上路

威望
228 点
冒险币
684 个
贡献值
0 点
好评度
0 点
发表于 2014-10-2 16:29:49 | 显示全部楼层 |阅读模式
开着服务端还很正常,但是过了几个小时后服务端就开始报下面的错误:
com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Could not create connection


to database server. Attempted reconnect 3 times. Giving up.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.Util.getInstance(Util.java:384)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:929)
        at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2226)
        at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2127)
        at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:774)
        at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:49)
        at sun.reflect.GeneratedConstructorAccessor10.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:375)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:289)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at database.DatabaseConnection.connectToDB(DatabaseConnection.java:102)
        at database.DatabaseConnection.getConnection(DatabaseConnection.java:36)
        at client.MapleClient.CheckIPAddress(MapleClient.java:1124)
        at handling.cashshop.handler.CashShopOperation.EnterCS(CashShopOperation.java:61)
        at handling.MapleServerHandler.handlePacket(MapleServerHandler.java:540)
        at handling.MapleServerHandler.messageReceived(MapleServerHandler.java:408)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived


(DefaultIoFilterChain.java:716)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived


(DefaultIoFilterChain.java:434)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200


(DefaultIoFilterChain.java:46)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived


(DefaultIoFilterChain.java:796)
        at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush


(ProtocolCodecFilter.java:427)
        at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived


(ProtocolCodecFilter.java:245)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived


(DefaultIoFilterChain.java:434)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200


(DefaultIoFilterChain.java:46)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived


(DefaultIoFilterChain.java:796)
        at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived


(IoFilterAdapter.java:119)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived


(DefaultIoFilterChain.java:434)
        at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived


(DefaultIoFilterChain.java:426)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.read


(AbstractPollingIoProcessor.java:715)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.process


(AbstractPollingIoProcessor.java:668)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.process


(AbstractPollingIoProcessor.java:657)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600


(AbstractPollingIoProcessor.java:68)
        at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run


(AbstractPollingIoProcessor.java:1141)
        at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure


The


last packet sent successfully to the server was 0 milliseconds ago. The driver has not received


any packets from the server.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:409)
        at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1118)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:343)
        at com.mysql.jdbc.ConnectionImpl.connectWithRetries(ConnectionImpl.java:2168)
        ... 38 more
Caused by: java.net.SocketException: No buffer space available (maximum connections reached?):


connect
        at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
        at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
        at java.net.PlainSocketImpl.connect(Unknown Source)
        at java.net.SocksSocketImpl.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.connect(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at java.net.Socket.<init>(Unknown Source)
        at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:256)
        at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:292)
        ... 39 more



哪位大神帮忙解决下,跪谢啊。。。。
经典冒险岛

41

回帖

0

主题

31

积分

新手上路

威望
0 点
冒险币
82 个
贡献值
0 点
好评度
0 点
发表于 2015-11-1 21:45:20 | 显示全部楼层
好东西谢谢分享
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

    申请友链|Archiver|手机版|

GMT+8, 2024-12-4 16:42 , Processed in 0.165994 second(s), 18 queries .

© 2001-2011 Powered by Discuz! X3.5. Theme By Yeei!

返回顶部