Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Adding new user and SchemaViolationException

2 views
Skip to first unread message

panda

unread,
Dec 4, 2000, 3:00:00 AM12/4/00
to
Hi all,
it might be a solved answer for some of you,please bear with me.

I am using the Java 1.3 JNDI SDK and Netscape Directory Server 4.1 to do my
LDAP operations.

When i create a new user using 'objectclasses' and try to use
createSubcontext liek as follows it shows me "SchemaViolationException".

The code is as follows
---------------------------------------

Attributes newAttributes = new BasicAttributes();
newAttributes.put(new
BasicAttribute("objectclass","organizationalperson"));
newAttributes.put(new BasicAttribute("givenName","Arthur"));
newAttributes.put(new BasicAttribute("sn","Knap"));
newAttributes.put(new BasicAttribute("cn","Arthur Knap"));

newAttributes.put(new BasicAttribute("mail","art...@endero.com"));
newAttributes.put(new BasicAttribute("uid","avdk"));
try{


DC.createSubcontext("uid=avdk,ou=members,o=root,o=BasseRoot",newAttributes);


---------------------------------------

How can i avoid it,when i use cn=avdk in place of uid=avdk also itr showing
me the same exception/

When i use Netscape SDK i have no problem but i wnat to use Java SDK.
Please help me ,it will eb a grate help.

Thanks and regards,
-Panda

Mark Wilcox

unread,
Dec 4, 2000, 3:00:00 AM12/4/00
to panda
you need to add all of the proper objectclasses (for example organizationaperson
doesn't support mail, inetorgperson does)

I think the code is something like:
String oc [] = ["top","person","organizationalperson","organizationalperson"];
newAttributes.put(new
BasicAttribute("objectclass",oc));

Mark

panda

unread,
Dec 5, 2000, 3:00:00 AM12/5/00
to
Now i changed Java SDK and tried with Nescape Directory SDK and it works
fine.

But can u tell me how to add a user to a group,i am not getting any netscape
documents regarding this.
Any sample or documenst will be a greta help.

--Panda

Mark Wilcox <mewi...@unt.edu> wrote in message
news:3A2C3EAF...@unt.edu...

0 new messages