directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Seshu Kumar" <>
Subject RE: problem with new schema and dump afterwards in APACHEDS
Date Tue, 28 Nov 2006 14:53:46 GMT
Thanks Alex, it went very fine. Now by modifying the Manifest file, it is
working fine.
Thanks again for your time.

-----Original Message-----
From: Alex Karasulu [] On Behalf Of Alex Karasulu
Sent: 28 November 2006 14:33
To: Apache Directory Developers List
Subject: Re: problem with new schema and dump afterwards in APACHEDS

Emmanuel Lecharny wrote:
> On 11/28/06, *Seshu Kumar* < 
> <>> wrote:
>     Hi Emmanuel,
>             Thanks for the info. Here I am just putting all the steps I
>     followed and please correct me, if any mistakes in the procedure -
>     Thanks.
>     - now tried to dump the data using command,
>                    java -jar apacheds-tools.jar dump -i
"C:\apacheds-1.0.0" -p onrelay -f dump.ldif
> What about :
> java -classpath 
> C:\apacheds-1.0.0\lib\preference-schema-1.0-SNAPSHOT.jar 
> -jar apacheds-tools.jar dump -i "C:\apacheds-1.0.0" -p onrelay -f

This will not work unfortunately :(.  It's my fault.

Basically the tools jar is an executable jar which has a bunch of 
classpath crud statically bound in it's manifest.  If you give the CP on 
the command line then you override the CP in the manifest I think.  So 
this executable jar is not using the class loader infrastructure built 
into the daemon bootstrappers which puts all jars in the lib/ directory 
on the bootclasspath.  This is stupid on my part because it should so 
dropping the jar into lib should make it get picked up.

This is a big problem because it will not enable us to use add on jars 
without supplying the whole darn classpath on the command line with the 
new jar.  This is just for this tools project.  So we need to make a fix 
to this.

Long term solutions

By long term I mean a quick 1.0.1 release.

1). Use the daemon bootstrapper infrastructure to start the tools just 
the way the server is started.  (the main bootstrapper would be used 
instead of JSvc or Procrun bootstrappers).

2). Copy the code in the main bootstrapper (superclass) that creates the 
classloader and use that in the main code.

I prefer #1.

Short term workaround

Unjar the tools jar in a temp directory.  Add your jar to the list of 
in the extracted manifest file.  Jar up the tools jar supplying the 
edited manifest file.  Overwrite the old tools jar with new one.  This 
time the command without any classpath should work.

Here's what your manifest should look like:

Manifest-Version: 1.0
Class-Path: logger.jar daemon.jar bootstrapper.jar
Specification-Title: apacheds-tools
Specification-Version: 1.0

Notice the last jar is your jar added to the classpath.  Again make sure 
there is a space on each new line before the .. and after the .jar at 
the end of the line.  I have had nasty problems in the past where some 
jars are not picked up because of this extra space.

If this does not work just add all these jars, your jar and the 
tools.jar to your classpath and start up this class:

That should work as well.

Good luck,

View raw message