0

I am using a shared Tomcat instance for many of my apps. I have configured some of the apps to use the JNDI data-source as described here, but others still are not. Because of this, they have kept the ojdbc jar in the web-inf/lib dir.

Unfortunately, this gives me an error :

Caused by: java.lang.IllegalArgumentException: interface oracle.jdbc.internal.ClientDataSupport is not visible from class loader

which is described here.

Do I have to have "all or nothing" in order to make this succeed?
Everything must be JNDI, or nothing must be JNDI?

Community
  • 1
  • 1
Brent Fisher
  • 132
  • 3
  • 12
  • The best bet is to use a data source for your database connection pool, regardless if you get it through JNDI or the application handles it on its own using a third party library like BoneCP or c3p0 – Luiggi Mendoza May 06 '14 at 14:18
  • Both options are using a datasource. My question is more around whether or not I can use a jndi data source _and_ spring configured datasources running in the same container. It seems that if a web app gets deployed with the same jdbc jars used for the jndi datasource, then it fails as described above. – Brent Fisher May 06 '14 at 22:13
  • It will be likely to fail since Tomcat class loader already loaded the jar, so the Spring project using the same jar should rely on the jar that should be already loaded by Tomcat (or whichever your application server is). If you're working with maven, just add `provided` to your library. – Luiggi Mendoza May 06 '14 at 22:57
  • Spring can be configured to use a `DataSource` set-up by Tomcat, or it can set up its own `DataSource` and use it. It's a bit unclear what you are asking, here. Can you provide more details? – Christopher Schultz May 07 '14 at 23:21

0 Answers0