This discussion is archived
1 Reply Latest reply: Aug 21, 2013 5:42 AM by 87b71de4-7323-4e2b-bcc3-79482118f898 RSS

Using JNDI to Create cnames in LDAP

87b71de4-7323-4e2b-bcc3-79482118f898 Newbie
Currently Being Moderated

Hello all,

 

First off, thank you for taking your time to read my post. As I am new to JNDI, I have a question regarding its integration with LDAP.

 

I am trying to write a Java program that will add cnames to my LDAP container. I have had some success in that the cname is created, however the objectClass attribute is initialized wrong and I have difficulty changing it. Here is the code that I have now along with the attributes that are initialized:

 

DirContext ctx = new InitialDirContext(env);
ctx.createSubcontext("cn=test,ou=orgUnit,o=org");

 

Attributes:

cn = test

objectClass = javaContainer

objectClass = Top

 

The correct attributes that I need the cname initialized with are as follows:

 

Attributes:

cn = test

objectClass = groupOfNames

objectClass = Top

ACL = ....

DirXML-Associations = ...

 

I have had no problem adding the ACL and DirXML-Associationg attributes. I have however tried replacing the existing objectClass attribute with a 'replace' command using the modifyAttributes function with no success. Does anybody have any ideas?


Thank you!

Josh

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points