directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "B G" <>
Subject [ApcaheDS] How to import schema without using LDAP Studio
Date Wed, 02 May 2007 21:31:33 GMT
Sorry for the double post, but I realized I did not have a subject...doh!


I recently upgraded from ApacheDS 1.0 to ApacheDS 1.5 and am embedding the
directory in an application.

Using 1.0 I was able to add custom schema using the maven plugin to compile
my schema classes from a .schema file and then using the bootstrap schema
mechanism to get it loaded into the directory. I came to realize that this
was not an option at all in 1.5 so I decided to use an ldif file to get my
schema loaded into the directory.

Unfortunately this does not work because there is a serious issue with
loading ldif files on a windows platform because the \ char (the file
seperator in windows) is interpreted as an escape for a hex sequence, so if
the following 2 bytes are possible hex then they are converted leaving the
path to the ldif file invalid. I have posted a thread on this issue as it
has made using ldif files with embedded directory on a windows platform
unusable if you cannot control the path to ensure there would be no hex

My next step was to use JNDI to add the schema programatically which I have
found to also be impossible. I did search around and found a document about
adding schema to 1.5:
which had code like the following:
DirContext ctx = new InitalDirContext(env);
DirContext schema = ctx.getSchema ("");

I find that this code just throws an UnsupportedOperationException as it is
hard coded to do in the ServerDirContext class. This all leaves it
impossible for me to add custom schema to a 1.5 directory so I feel like I
must be missing something fundamental.

Also, for my application purposes I am not really able to use LDAP Studio to
import the ldif as the schema needs to be added upon my application first
starting which in turn will do a first start on the directory.

Is there a way to get my compiled schema classes into the directory now that
the bootstrap schema mechanism has been removed?

Any help would be greatly appreciated with regard to what I am missing here
or if there is a way to work around these issues without using LDAP Studio.

Thanks a lot!!!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message