I have recently upgraded an application from java 1.7 to 1.8. Rest of the libraries versions remains unchanged. I am getting the following error after the upgrade:
DEBUG 2015-11-12 09:55:12 BasicResourcePool An exception occurred while acquiring a poolable resource. Will retry.
java.lang.NullPointerException
at oracle.net.jndi.JndiAttrs.getAttrs(JndiAttrs.java:207)
at oracle.net.resolver.AddrResolution.<init>(AddrResolution.java:198)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:219)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1102)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:320)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:546)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:236)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521)
at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:134)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:182)
at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:171)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:137)
at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1014)
at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:32)
at com.mchange.v2.resourcepool.BasicResourcePool$AcquireTask.run(BasicResourcePool.java:1810)
at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:547)
Hibernate configurations:
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@ldaps://XXXX,cn=OOOO,dc=WWW</property>
<property name="hibernate.connection.username">YYYY</property>
<property name="hibernate.statement_cache.size">0</property>
<property name="hibernate.connection.password">ZZZZZ</property>
<property name="hibernate.c3p0.min_size">5</property>
<property name="hibernate.c3p0.max_size">20</property>
<property name="hibernate.c3p0.timeout">1800</property>
<property name="hibernate.c3p0.max_statements">0</property>
<property name="hibernate.default_schema">YYYY</property>
<property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>
<property name="hibernate.show_sql">true</property>
</session-factory>
</hibernate-configuration>
Related Libraries used:
Problem:
The dependencies contained 2 hibernate version 3.1 and 3.0 and ojdbc6 and ojdbc7. (used mvn dependency:tree -Dverbose
to got dependency tree)
Solution: Excluded the other versions of hibernate and ojdbc from the dependencies.
<dependency>
<groupId>****</groupId>
<artifactId>****</artifactId>
<version>****</version>
<exclusions>
<exclusion>
<groupId>hibernate</groupId>
<artifactId>hibernate</artifactId>
</exclusion>
<exclusion>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
</exclusion>
</exclusions>
</dependency>
As noted, ojdbc6 and 7 are both successfully used with 19c.
For Oracle 19c, you can use either ojdbc8. jar or ojdbc10. jar. OJDBC10 is compiled with Java 10 and will not work unless you're running Bamboo 8 with Java 11.
According to the Oracle JDBC FAQ (Question "What are the Oracle JDBC releases Vs JDK versions?"), only the Java versions you listed (Java 8 to 11) are supported for Oracle 19c.
Also note that if you want to know from which Oracle Database release the jar comes from you can run java -jar ojdbc8. jar . Both the Database and the driver are backward compatible (up to 1 major release) so, even though it's recommended, you don't have to use the same version of the product on both tiers.
As i can see from the Oracle FAQ, the jdbc driver you are using is not compatible with the Database Version and JDK8.
What are the various supported Oracle database version vs JDBC compliant versions vs JDK version supported?
I think this must be your problem. Maybe if you used ojdbc7.jar might help (not sure about this cause I haven't tested it yet - MOST PROBABLY THIS WOULD FAIL)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With