Search code examples
javaoraclejdbc

org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection


I have a java application that accesses several services. They've always worked correctly, and then all of a sudden I get the following error when trying to run one of them:

org.hibernate.exception.JDBCConnectionException: Unable to open JDBC Connection

I know that the username and password are correct, and that it is only affecting one service even though all of them use the same process.

I've pasted the stack trace below.

    at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:774) ~[ojdbc8.jar:12.2.0.1.0]
    at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:688) ~[ojdbc8.jar:12.2.0.1.0]
    at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:39) ~[ojdbc8.jar:12.2.0.1.0]
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:691) ~[ojdbc8.jar:12.2.0.1.0]
    at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138) ~[HikariCP-4.0.3.jar:na]
    at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364) ~[HikariCP-4.0.3.jar:na]
    at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206) ~[HikariCP-4.0.3.jar:na]
    at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476) ~[HikariCP-4.0.3.jar:na]
    at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561) ~[HikariCP-4.0.3.jar:na]
    at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115) ~[HikariCP-4.0.3.jar:na]
    at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112) ~[HikariCP-4.0.3.jar:na]
    at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122) ~[hibernate-core-5.6.15.Final.jar:5.6.15.Final]


Solution

  • Have there been any updates (lib, OS, IDE, etc) or network policy changes? This can impact your application without you directly modifying the code or configuration.

    I provide support on legacy systems, which used the TLS 1.1 protocol and were no longer supported. At the company I work for, the newest TLS protocol has been enabled. Then, out of nowhere, the system stopped accessing other applications.

    Your case may be similar.

    To solve the problem, we implemented a simple Ruby on Rails application, which served as a proxy between the legacy applications and the rest of the applications on the network.