Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Oracle ClassNotFound, where MySQL works fine(Implementing Oracle and MySQL connections identically, but Oracle connection throws ClassNotFoundException)
Oracle ClassNotFound, where MySQL works fine [message #516444] Tue, 23 February 2010 23:24 Go to next message
Mark Leone is currently offline Mark LeoneFriend
Messages: 123
Registered: July 2009
Senior Member
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 23:28]

Report message to a moderator

Re: Oracle ClassNotFound, where MySQL works fine [message #516665 is a reply to message #516444] Wed, 24 February 2010 17:28 Go to previous message
Mark Leone is currently offline Mark LeoneFriend
Messages: 123
Registered: July 2009
Senior Member
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 17:28]

Report message to a moderator

Previous Topic:SQL Results Viewer
Next Topic:Oracle ClassNotFound, where MySQL works fine
Goto Forum:
  


Current Time: Sun Nov 23 21:37:05 GMT 2014

Powered by FUDForum. Page generated in 0.04389 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software