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: packaging derby.jar in application jar file
Date Sat, 02 Apr 2011 14:24:16 GMT
On 04/01/2011 07:40 PM, Kris Hayden wrote:
> hello. i have been coding an application by hand and have been having
> a hard time getting the derby.jar file to be loaded from inside my jar

Do you literally mean a jar-within-a-jar, not a jar-within-a-war and
not a jar-within-a-ear? I don't think that the basic JDK jar loading
utilities are capable of resolving class references to a jar within a jar;
that sort of fancy class loading is generally done by the application
class loaders found in application servers.

The mechanism of having your manifest refer to a separate jar file is
the only way I know of for the basic JDK jar loader to affect the class path.

If you want to package everything as a single jar, you could try
un-jarring all the Derby code into simple .class files and then re-packaging
it into a single jar with no internal structure, just all .class files
within the jar.

But really, this is a lot of work; I think it would be easier to
keep the Derby jars separate, in their existing jar files, and re-design
your application strategy to allow for multiple jar files in the overall

For one thing, the Derby security policy implementation assumes that the
Derby jars are left as is, not re-packaged.

Can you describe some of the reasons that you want to repackage Derby?



View raw message