0

While connecting to an AWS rds mysql instance I am getting the below error.

This happens only when I deploy 2 different wars on the same tomcat instance. Both apps connect to their corresponding DB instance (Separate DBs).

If I deploy them separately I don't have an issue.

Here is the error:

com.mysql.cj.jdbc.exceptions.CommunicationsException: Communications link failure

27-Jul-2018 18:31:06.214 SEVERE [pool-27-thread-3] org.apache.tomcat.jdbc.pool.ConnectionPool.init Unable to create initial connections of pool.
 com.mysql.cj.jdbc.exceptions.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 com.mysql.cj.jdbc.exceptions.SQLError.createCommunicationsException(SQLError.java:741)
    at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:57)
    at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:1663)
    at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:662)
    at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:352)
    at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:221)
    at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:307)
    at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:200)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.createConnection(ConnectionPool.java:728)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.borrowConnection(ConnectionPool.java:662)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.init(ConnectionPool.java:480)
    at org.apache.tomcat.jdbc.pool.ConnectionPool.<init>(ConnectionPool.java:154)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.pCreatePool(DataSourceProxy.java:115)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.createPool(DataSourceProxy.java:102)
    at org.apache.tomcat.jdbc.pool.DataSourceProxy.getConnection(DataSourceProxy.java:126)
    at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:139)
Nicholas DiPiazza
  • 10,029
  • 11
  • 83
  • 152
Yoga Gowda
  • 357
  • 4
  • 8
  • can you see if this is a duplicate question by seeing if this is your problem? https://stackoverflow.com/questions/49024179/springboot-mysql-jdbc-unable-to-create-initial-connections-of-pool – Nicholas DiPiazza Jul 28 '18 at 01:59
  • Thanks Nicholas, in my case if I deploy just one app, I don't have any issue, it works fine. The moment if I deploy 2 apps, getting this problem – Yoga Gowda Jul 29 '18 at 00:51

0 Answers0