Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using JNDI to Create cnames in LDAP

1014801Aug 21 2013 — edited Aug 21 2013

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

This post has been answered by 1014801 on Aug 21 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 18 2013
Added on Aug 21 2013
1 comment
171 views