Question

I use weblogic 10. Its provide an Oracle JDBC driver 10.2.0.2 (in the server/lib on weblogic home).

Actually someone at work put a long time ago a 10.2.0.3 driver in instance libext folder.

But in production we got a jdbc driver stack (nullpointer :O) and by reverse engineering it seems we are using driver 10.2.0.2.

We know that we could change the driver in the server/lib of weblogic but i want to understand.

Isn't libext supposed to override server libs like META-INF libs override libext?

By the way we are in a strange situation: - We have 2 EAR, and for the exact same treatment in those 2, one will sometime throw the oracle driver nullpointer while the other doesn't - I wonder if one ear isn't using 10.2.0.2 while the other is using 10.2.0.3 (i saw a bug fixed that could fit to our problem for this version). - I need to look better but at first sight both ear use the exact same datasource set in weblogic JNDI resources

Any idea?

Was it helpful?

Solution

No one should be putting anything into the lib/ext directory, especially not JDBC driver JARs. That directory is for library extensions. I'd remove that JAR from lib/ext immediately.

As you say, if the 10.2.0.3 version is a bug fix, the correct place to put it would be server/lib, not lib/ext.

Two EARs means two separate servers or two different ports? I'm not sure why WebLogic would pick one driver up over the other for the same configuration.

OTHER TIPS

As @duffymo and Oracle docs state: http://download.oracle.com/docs/cd/E11035_01/wls100/jdbc_admin/third_party_drivers.html#wp1048361 the driver location should be server/lib.

Can you run this from a JSP on each EAR - this should give you the jar file from where the driver is loaded.

try {
  String candidate = "oracle.jdbc.driver.OracleDriver";
  Class clazz = Class.forName(candidate);
  java.security.ProtectionDomain dom = clazz.getProtectionDomain();
  java.security.CodeSource cs = dom.getCodeSource();
  java.net.URL url = cs.getLocation();
  out.println("<TITLE>" + candidate + "</TITLE></head><body>");
  out.println("Path for " + candidate + " = " + url.getFile());
} catch (Exception t) {
  t.printStackTrace(response.getWriter());
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top