Trying to setup a db connection pool with dbcp2 and Oracle db in cloud.
Encountering this error when attempting to connect to Oracle Autonomous database. Weirdest part is even though this error is encountered I dont get any errors when interacting with services built on the webapp when this connection pool begins to get used for ex adding a user, extracting reports etc.
The database is tcps enabled and I am using Oracle Wallets to connect to the same.
Error is consistently reproduced, so on the fence if its some network issue
Any ideas what might be causing this error?
java.sql.SQLException: Error preloading the connection pool
at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:573) ~[commons-dbcp2-2.8.0.jar:2.8.0]
at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:734) ~[commons-dbcp2-2.8.0.jar:2.8.0]
at com.testme.mmappserver.upgrade.start.MartUpgrade.isMartVersionPresent(MartUpgrade.java:176) ~[classes/:?]
at com.testme.mmappserver.upgrade.start.MartUpgrade.upgrade(MartUpgrade.java:129) ~[classes/:?]
at com.testme.mmappserver.upgrade.start.MartUpgrade.upgrade_main(MartUpgrade.java:81) [classes/:?]
at com.testme.mmappserver.upgrade.Configui$11.run(Configui.java:499) [classes/:?]
Caused by: java.sql.SQLRecoverableException: No more data to read from socket
at oracle.jdbc.driver.T4CMAREngineNIO.prepareForUnmarshall(T4CMAREngineNIO.java:784) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4CMAREngineNIO.unmarshalUB1(T4CMAREngineNIO.java:429) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4C8TTIpro.receive(T4C8TTIpro.java:134) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1623) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:588) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:793) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:57) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:747) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:562) ~[ojdbc8-19.3.0.0.jar:19.3.0.0.0]
at org.apache.commons.dbcp2.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:52) ~[commons-dbcp2-2.8.0.jar:2.8.0]
at org.apache.commons.dbcp2.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:357) ~[commons-dbcp2-2.8.0.jar:2.8.0]
at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:918) ~[commons-pool2-2.9.0.jar:2.9.0]
at org.apache.commons.pool2.impl.GenericObjectPool.addObject(GenericObjectPool.java:1023) ~[commons-pool2-2.9.0.jar:2.9.0]
at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:569) ~[commons-dbcp2-2.8.0.jar:2.8.0]
... 5 more
java.sql.SQLRecoverableExceptionis used when a particular statement could potentially work, if invoked again, after issues such as a tablespace was out of space (and later fixed), a timeout occurred, etc. Now, it would be nice if you can find out what is causing the first try to fail, but you may want to try (temporarily) to put that statement in a loop, with a pause in the loop for say 60 seconds, and loop for maybe 5 times. Then if it works on the second time, always... that could be a work-around.