每次尝试运行此rs私有服务器时,都会出现此控制台错误。几乎所有东西都连接到一个mysql db。
我一直在讨论这个问题很长一段时间,但是无法弄清楚什么是错的。如果有任何特定的文件你可能需要查看以帮助我弄清楚什么是错的,告诉我,我会发布它。
所有帮助都将受到高度赞赏!
[Stage - 1] Launching Elunity...
[Stage - 2] Loaded object configurations
[Stage - 3] Loaded region configurations
com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 1 432 637 479 787 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
Failed to connect to MySQL database
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:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2214)
at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:773)
at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:46)
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:406)
at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)
at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:282)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at paladious.model.players.Highscores.process(Highscores.java:17)
at paladious.Server.main(Server.java:117)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 1 432 637 479 777 milliseconds ago. The last packet sent successfully to the server was 0 milliseconds ago.
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:406)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1074)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:341)
at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2137)
... 13 more
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
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:253)
at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:290)
... 14 more
[Stage - 4] Loaded single event manager
[Stage - 7] Loaded NPC drops
[Stage - 8] Loaded player punishments and starters
[Stage - 10] Elunity online on port :43594
提前致谢! :)
答案 0 :(得分:0)
这是一个包装的例外,并不是很有趣。它是异常的根本原因,它实际上告诉我们一些根本原因。请在堆栈跟踪中进一步了解一下。您将面临SQLException的可能性很大:连接被拒绝或SQLException:连接超时。
如果你的情况也是如此,那么所有可能的原因都是:
要解决其中一个问题,请遵循以下建议: