[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Problem adding objectClass posixAccount using Novell's JLDAP
On Mon, Nov 3, 2008 at 11:29 PM, Nuno <nunogt@gmail.com> wrote:
I'm using Novell's JLDAP Java library (available from http://www.openldap.org/jldap/) to talk to my OpenLDAP server from an application developed in-house. It's been a pretty straightforward ride: I can list users, change attributes, etc. There is, however, one thing I haven't yet been able to implement - create a new user that inherits the objectClass "posixAccount". According to Novell's code samples, to create such an entry, one would do:
LDAPEntry entry = new LDAPEntry(cn);
LDAPAttributeSet attrSet = new LDAPAttributeSet();
// Object class descriptions
attrSet.add(new LDAPAttribute("objectclass", new String("inetOrgPerson")));
you have not added the posixAccount objectclass (or the object that defines the attributes it complains about), like :
// Object class descriptions
attrSet.add(new LDAPAttribute("objectclass", new String("posixAccount")));
attrSet.add(new LDAPAttribute("objectclass", new String("inetOrgPerson")));
Each objectclass value you add expands the set of allowable attributes that you may (in some cases, must) use, by the number of attributes defined by that object.
If you dont include the required objecttype(s), you cannot use the attributes they define, which is what the error is about.
eg: posixAccount allows gidNumber, uidNumber, etc.,
inetOrgPerson allows userPassword, descrption etc.,
Cheers
Brett