1

We are using hibernate, Spring,Oracle Db for our application. We are using below versions.

spring.version : 4.2.1.RELEASE
hibernate.version :5.0.1.Final
jackson.version :2.6.1
gson.version>2.3
log4j.version>1.2.17
org.apache.poi.version>3.10-FINAL
validation-api.version>1.1.0.Final

When we try to load a Driver class for Datasource that time we got below Exception. we already add the ojdbc14.jar in class path but still it gives the same exception.

17:04:09 DEBUG [localhost-startStop-1] - com.mchange.v2.c3p0.impl.C3P0PooledConnectionPoolManager.getPool -Created new pool for auth, username (masked): 'DD******'.
17:04:09 DEBUG [localhost-startStop-1] - com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource -acquire test -- pool size: 0; target_pool_size: 10; desired target? 1
17:04:09 DEBUG [localhost-startStop-1] - com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable -awaitAvailable(): [unknown]
17:04:09 DEBUG [localhost-startStop-1] - com.mchange.v2.resourcepool.BasicResourcePool.trace -trace com.mchange.v2.resourcepool.BasicResourcePool@1cd5846 [managed: 0, unused: 0, excluded: 0]
17:04:09  WARN [C3P0PooledConnectionPoolManager[identityToken->2sp4cc9b1vxk7vaqqsqro|9ac35b]-HelperThread-#1] - com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded -Could not load driverClass oracle.jdbc.driver.OracleDriver
java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1720)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1571)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:190)
    at com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded(DriverManagerDataSource.java:112)
    at com.mchange.v2.c3p0.DriverManagerDataSource.getConnection(DriverManagerDataSource.java:144)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:195)
    at com.mchange.v2.c3p0.WrapperConnectionPoolDataSource.getPooledConnection(WrapperConnectionPoolDataSource.java:184)
    at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.acquireResource(C3P0PooledConnectionPool.java:200)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquire(BasicResourcePool.java:1086)
    at com.mchange.v2.resourcepool.BasicResourcePool.doAcquireAndDecrementPendingAcquiresWithinLockOnSuccess(BasicResourcePool.java:1073)
    at com.mchange.v2.resourcepool.BasicResourcePool.access$800(BasicResourcePool.java:44)
    at com.mchange.v2.resourcepool.BasicResourcePool$ScatteredAcquireTask.run(BasicResourcePool.java:1810)
    at com.mchange.v2.async.ThreadPoolAsynchronousRunner$PoolThread.run(ThreadPoolAsynchronousRunner.java:648)
17:04:09  WARN [C3P0PooledConnectionPoolManager[identityToken->2sp4cc9b1vxk7vaqqsqro|9ac35b]-HelperThread-#0] - com.mchange.v2.c3p0.DriverManagerDataSource.ensureDriverLoaded -Could not load driverClass oracle.jdbc.driver.OracleDriver
dreamcrash
  • 47,137
  • 25
  • 94
  • 117
Rahul Sawant
  • 1,223
  • 9
  • 12
  • have you added the oracle driver in your classpath? – soorapadman Sep 22 '15 at 12:11
  • 1
    Might be your ojdbc driver file is corrupt. Try to download it again and add to the build path. Also, make sure that the jar is made available in the package stage and goes with the deployment structure. – James Jithin Sep 22 '15 at 12:36

1 Answers1

0

also check below worked for me long time back

Run As -> Run configurations -> select your server from type filter text box

Then in Classpath under Bootstrap Entries add your classes12.jar File and Click on Apply.
Now, run the file

check oracle.jdbc.driver.OracleDriver ClassNotFoundException similar

Rahul Sawant
  • 1,223
  • 9
  • 12