users@glassfish.java.net

Re: Where to put libraries ??

From: <glassfish_at_javadesktop.org>
Date: Wed, 16 Jan 2008 23:32:22 PST

It's the problem with the JDK code. While it allows to register any jdbc driver that can be available on the classpath, it looks for the driver loaded only by the caller's classloader (or classloader abov it) when getConnection() is called on the DriverManager.

So you need to have the jdbc driver loaded either by the same classloader as the TopLink (i.e. place it in the same location as the toplink-essentials.jar) or higher in the classloaders hierarchy. When you have 2 of them, the "wrong one" could've been loaded first, and the 2nd one won't be even checked when the getConnection() call comes in.

Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

http://forums.java.net/jive/thread.jspa?messageID=254366