Oracle ClassNotFound, where MySQL works fine [message #516444] |
Tue, 23 February 2010 18:24  |
Eclipse User |
|
|
|
I have a MySQL driver and associated profile that's been working for months. I tried to implement Oracle in the same fashion, and I get a ClassNotFoundException for the Oracle driver.
I do the following for both MySQL and Oracle drivers and connection profiles:
I contribute to org.eclipse.datatools.connectivity.driverExtension, overriding template org.eclipse.datatools.enablement.oracle.10.driverTemplate (or equivalent MySQL template), and specifying a valuesProvider. The valuesProvider confirms existence of a url for ojdbc14.jar (or MySQL connector jar), which is wrapped by another plug-in. I verify in the debugger that the url is correct (it's a bundle-relative URL that points to the jar file in the top level directory of the Plug-in).
I then create a connection profile for the driver. When an attempt is made to open a connection, DTP Oracle enablement tries to load the driver class, and the class loader throws a ClassNotFoundException for.oracle.jdbc.OracleDriver.
It's a URLClassLoader that throws the exception. The URL is correct and points to the jar file where the class is present. I don't know what else I can do to specify where the class can be loaded from; and I don't know why the same code works fine with MySQL.
[Updated on: Tue, 23 February 2010 18:28] by Moderator
|
|
|
Re: Oracle ClassNotFound, where MySQL works fine [message #516665 is a reply to message #516444] |
Wed, 24 February 2010 12:28  |
Eclipse User |
|
|
|
I stepped through the debugger on URLClassLoader and discovered that eclipse was holding on to an old version of my target directory, which didn't have the Oracle driver jar plug-in. I cleared the workspace, and both connections are working.
[Updated on: Wed, 24 February 2010 12:28] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03705 seconds