0

First of all, I have to say I am currenty using the connection pool of Apache. I need to put the oracle jdbc jar into the app folder (WEB-INF/lib) but not into the tomcat lib folder. If I put the jar into the tomcat lib everything works fine, otherwise I get the following error messages:


set 01, 2016 12:23:10 PM org.apache.tomcat.jdbc.pool.ConnectionPool init
GRAVE: Unable to create initial connections of pool.
java.sql.SQLException: oracle.jdbc.driver.OracleDriver
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)

set 01, 2016 12:23:10 PM org.apache.naming.NamingContext lookup
AVVERTENZA: Unexpected exception resolving reference
java.sql.SQLException: oracle.jdbc.driver.OracleDriver
at org.apache.tomcat.jdbc.pool.PooledConnection.connectUsingDriver(PooledConnection.java:254)
at org.apache.tomcat.jdbc.pool.PooledConnection.connect(PooledConnection.java:182)

I have been looking for a solution for days but still I can't come up with something useful. I checked many forums but they just say that it is not very performing putting the jar into web-inf/lib but they don't say if it is really possibile to do it. My manger has been pushing me for a week for a solution, she wants the jdbc driver into the web-inf/lib of the web-app.

Any solution? Anyone who can help me?

Diego
  • 1
  • 1
  • Show your code, how you create / configure the connection pool. – Jozef Chocholacek Sep 01 '16 at 11:48
  • 1
    Simply change your connection pool, i.e. to [DBCP2](http://commons.apache.org/proper/commons-dbcp/) or [Hikari](https://github.com/brettwooldridge/HikariCP). – Stefan Sep 01 '16 at 11:53
  • It must be in the tomcat's lib/ directory. The webapps and the Tomcat itself uses different ClassLoaders. The ojdbc registers itself into a singleton that gets screwed up if you don't follow the documentation. – Koshinae Sep 01 '16 at 12:01
  • Possible duplicate of [Why must the jdbc driver be put in TOMCAT\_HOME/lib folder?](http://stackoverflow.com/questions/6981564/why-must-the-jdbc-driver-be-put-in-tomcat-home-lib-folder) – Koshinae Sep 01 '16 at 12:01
  • Thanks but I already read it. I am looking for a possible solution. Everybody are just saying that putting the jar in web-inf/lib is a poor solution that lacks of performance. I need a solution or someone who can tell me that what I am looking for is impossible. Besides, I am not really looking for it but my manger... Pleaseeee! – Diego Sep 01 '16 at 12:55
  • if the jar is in web-inf/lib then you have to create the datasource in your application with DBCP2, HikariCP. Tomcat is unable to create the datasource as it "doesn't" see the driver jar. – benbenw Sep 02 '16 at 17:27

0 Answers0