Root exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

I am getting the below error when i execute the ./start-appserver.sh for tomcat. i have checked the custom.properties file and and tomcatResource.xml my data source name is same.

2024-04-04 10:38:20 WARNING [main] org.apache.catalina.core.NamingContextListener.addResource Failed to register in JMX: [javax.naming.NamingException: Unexpected exception resolving reference [Root exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

The last packet successfully received from the server was 882 milliseconds ago.  The last packet sent successfully to the server was 864 milliseconds ago.]]
2024-04-04 10:38:24 INFO [main] org.apache.catalina.core.ApplicationContext.log No Spring WebApplicationInitializer types detected on classpath
Thu Apr 04 10:38:29 GMT 2024 WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification.
2024-04-04 10:38:29 SEVERE [wait-for-component] org.apache.tomcat.jdbc.pool.ConnectionPool.init Unable to create initial connections of pool.
    com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    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 have one or more of the following causes:

    1. IP address or hostname in JDBC URL is wrong.
    2. Hostname in JDBC URL is not recognized by 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.
Reply
  • 0
    Certified Lead Developer

    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 have one or more of the following causes:

    1. IP address or hostname in JDBC URL is wrong.
    2. Hostname in JDBC URL is not recognized by 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.
Children
No Data