'Getting intermittent error java.sql.SQLException: ORA-01005: null password given; logon denied issue

I am creating database connection pool using Hikari and it connects and create connection pool successfully on application startup. Application also works fine but then intermittently i am getting ORA-01005: null password given; logon denied issue

Below are some details

Database ->

  • name : Oracle
  • version : Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production major : 19 minor : 0

Driver ->

  • name : Oracle JDBC driver
  • version : 11.2.0.3.0 major : 11 minor : 2

This is how i am creating datasource

passing password as String variable. ( which is not null and not empty )

@Bean(name = "testDataSource")
    @ConfigurationProperties(prefix = "ccb.test.datasource")
    public DataSource dataSourceAPAC() {
        logger.info("Attempting to Initialize TEST datasource");

        return DataSourceBuilder.create().password("*******").build();
    }

Error logs

*java.sql.SQLException: ORA-01005: null password given; logon denied
                at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:445)
                at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:389)
                at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:382)
                at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:600)
                at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:445)
                at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:450)
                at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:192)
                at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:380)
                at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:760)
                at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:401)
                at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
                at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)*


Solution 1:[1]

This issue got resolved by upgrading Oracle JDBC driver to 12.1.0.1 version.

<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc7</artifactId>
<version>12.1.0.1</version>
</dependency>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 codiacTushki