db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendleton.de...@gmail.com>
Subject Re: Problem with Class.forName
Date Sat, 24 Aug 2013 22:10:44 GMT
> Here's the output:
> java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver


It sure seems like a classpath problem, but you can find the
class when you run simple utilities like ij or sysinfo.

Perhaps the classpath that your application is running with is
somehow different, or perhaps something else is interfering with
loading the class.

You could try something like this:
to have your application dump the classpath to see if it's what
you expect it to be.

Two more things to try:

1) Run 'java org.apache.derby.tools.ij', then do

	connect 'jdbc:derby://localhost/C:/Users/Doc/Documents/JavaDB/Learning/Users';

    That will at least prove 100% that you can connect to your database
    using the ClientDriver, from "ij".

2) Run your test program with 'java -verbose:class', which might give
    you some clues about where it's looking for classes.

Here's a web page with other things you could try:


One other thing occurs to me: I know that sometimes there can be
multiple copies of Derby installed on the system, and if the
multiple copies are of multiple different versions, that can
disrupt the class loading. So if you have more than one copy of
Derby on your system, make sure that your CLASSPATH is as narrow
as possible and only includes the Derby that you intend to run.


View raw message