Sidebar

How can I resolve this error?

0 votes
744 views
asked Apr 6, 2020 by wilma-c-7883 (200 points)
[func: 1 line: 4] WrappedException: Wrapped com.qvera.qie.exception.NoResultsException: 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.
Caused by: java.net.ConnectException: Connection timed out: connect

 

-  my driver class is MySQL. Hope you will help me to fix this error. Thank you.

1 Answer

0 votes

If you get a SQLException: Connection refused or Connection timed out or a MySQL specific CommunicationsException: Communications link failure, then it means that the DB isn't reachable at all. This can be from one or more of the following causes:

  1. IP address or hostname in JDBC URL is wrong.
  2. The hostname in the JDBC URL is not recognized by the local DNS server.
  3. Port number is missing or wrong in JDBC URL.
  4. DB server is down.
  5. DB server doesn't accept TCP/IP connections.
  6. DB server has run out of connections.
  7. Something in between Java and DB is blocking connections, e.g. a firewall or proxy.
answered Apr 6, 2020 by gary-t-8719 (14,860 points)
commented Apr 7, 2020 by wilma-c-7883 (200 points)
1. IP address or hostname in JDBC URL is wrong.
-Cannot be as the same url works fine on another comp

2.The Hostname in JDBC URL is not recognized by local DNS server.
-I tried /127.0.0.1:3306/database, /localhost:3306/database, /localhost/database, / xx.xx.xx-xx-2.rds.amazonaws.com
:3306/database, same error no matter what

3.Port number is missing or wrong in JDBC URL.
-it's 100% port 3306

4.DB server is down.
-not down as it accepts remote access

5.DB server doesn't accept TCP/IP connections.
-clearly it does accept if it works from my pc

6.DB server has run out of connections. -||-

7.Something in between Java and DB is blocking connections, e.g. a firewall or proxy.
-the inbound rule is 0.0.0.0 so it should work form both local and remote
commented Mar 25, 2022 by michael-m-7621 (120 points)
What was the final resolution to this issue?
...