I am facing a problem wherein I cannot extend the
schema of openLDAP with JNDI. The same code works perfectly with Netscape
Directory Server.
The piece of code is
:
The code already has got a schema DirContext called
schema, and has set a variable NameOfAttribute as Attribute Name and in the
BasicAttributes class has set the values of the NumericOID, syntax etc. This
does not work for OpenLDAP. The same code works otherwise.(the security
credentials etc. have already been taken care of)
DirContext newAttr2 =
schema.createSubcontext("AttributeDefinition/"+NameOfAttribute,
attrs);
I got around this problem by adding the attributes
directly in a text file and also the objectclass I desired. Then I included it
in he slapd.conf. But, if there is a method of directly adding attributes and
classes into the schema through JNDI, I wouod like to know of it.
Please note that I am able to read a Class and
Attribute definitions by using
Attributes
attributes=d.getAttributes("ClassDefinition/organizationalunit"); attributes=d.getAttributes("AttributeDefinition/lastmodifieddate");
I get the exception
javax.naming.NameNotFoundException:
[LDAP: error code 32 - No Such Object]; remaining name ''
on trying to add an attribute.
All help is welcome,
Rajesh |