db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Watts <...@cliftonfarm.org>
Subject Re: Correct Derby software ?
Date Thu, 21 Jun 2012 13:21:56 GMT
On Thu, 2012-06-21 at 13:54 +0200, Isabelle DASTUGUE wrote:
> Hello,
> I have a Derby database that works when I start it from Eclipse, but
> when I try to run it from the. Jar of my application, it does not
> work.
> Here are two successive errors:
> java.sql.SQLException: Failed to start database 'C:\Test\Base' with
> class loader sun.misc.Launcher$AppClassLoader@35ce36, see the next
> exception for details.
> then
> Caused by: java.sql.SQLException: Startup failed due to missing
> functionality for org.apache.derby.iapi.store.access.AccessFactory.
> Please ensure your classpath includes the correct Derby software.
> I put the Derby access to my files in the classpath in environment
> variables, but it's still not working.
> My four files:
> - Derby.jar,
> - Derbyclient.jar,
> - Derbynet.jar,
> - Derbytools.jar.
> Are exactly the same and on the same PC ...
> Without the call to the base, my. Jar works.
> With the base, I create the server, do I start Derby, I run the
> instance but I cannot connect to the database at the address returned
> is obviously good ...
> Any idea?
Check if there is a Class-Path entry in your jar's META-INF/MANIFEST.MF
file.  If there is, then the dependent jars need to be specified there
(space separated).  The jar locations must be specified relative to
my.jar (IMPORTANT!).  So if my.jar and derbyclient.jar in the same dir
then the entry should look like this:

        Class-Path: derbyclient.jar

But if my.jar is in base/ and derbyclient.jar is in home/libs then this:

        Class-Path: libs/derbyclient.jar

and base/ needs to be in CLASSPATH (so that my.jar will be found).

See: http://docs.oracle.com/javase/6/docs/technotes/guides/jar/jar.html
for all details on jars and manifests.

(btw, if your app is using derby in client mode then I don't think you
need all those jars, just derbyclient.jar).

> Cordially
> Isabelle DASTUGUE

View raw message