[Date Prev][Date Next] [Chronological] [Thread] [Top]

Schema Update Using JNDI

Hi All,

I'm trying to dynamically modify the schema of an openLDAP server running on
LINUX using JNDI as outlined in the Sun tutorial
(http://java.sun.com/products/jndi/tutorial/ldap/schema/object.html) . When
I try to add a new object class to the schema I get the following:

Error [LDAP: error code 53 - modification of subschema subentry not

The calling code looks like:

// Specify attributes for the schema object
Attributes attrs = new BasicAttributes(true); // Ignore case
attrs.put("NUMERICOID", "");
attrs.put("NAME", "fooObjectClass");
attrs.put("DESC", "for JNDITutorial example only");
attrs.put("SUP", "top");
attrs.put("STRUCTURAL", "true");
Attribute must = new BasicAttribute("MUST", "cn");

// Get the schema tree root
DirContext schema = ctx.getSchema("");

// Add the new schema object for "fooObjectClass"
DirContext newClass =
schema.createSubcontext("ClassDefinition/fooObjectClass", attrs);

I have populated the server with the tutorial ldif file and all other
directory functions seem to work fine.

Is it possible to dynamically add to the schema using Java as shown above?
Any help appreciated.

Many Thanks