0

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
4
  • 1
    So do you see this error just occasionally during the day, or just at startup, or every time a user logs in? Commented Feb 26, 2021 at 20:55
  • @MarkStewart I get the error when attempting to execute a procedure during the startup Commented Feb 27, 2021 at 6:28
  • 1
    In theory, the java.sql.SQLRecoverableException is 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. Commented Mar 1, 2021 at 14:47
  • 1
    the error was not being reproduced in any another dev machine so probably something wrong wih my env. ignoring it for the time being. Commented Mar 5, 2021 at 5:35

2 Answers 2

1

The version of the Oracle JDBC driver you're using is very old. I would recommend you to update that to the latest appropriate one for your DBMS version. Please refer the attached page url, this might be helpful.

Error:No more data to read from socket

Sign up to request clarification or add additional context in comments.

1 Comment

I am already using the driver applicable for my database. ojdbc8-19.3.0.0.
0

It may be that you're exceeding the total number of connections that are allowed to your autonomous database. So you may just add a limit to your dbcp2 pool. You can try with just a couple of connections (for init, min and max) and see if the error reproduces.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.