[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
supported]

The calling code looks like:

// Specify attributes for the schema object
Attributes attrs = new BasicAttributes(true); // Ignore case
attrs.put("NUMERICOID", "1.3.6.1.4.1.42.2.27.4.2.3.1.1.1");
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");
must.add("objectclass");
attrs.put(must);

// 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

Tom.