Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JNDI Error in creating entries in LDAP's Active Directory.  RSS feed

Jesu Mani
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Trying to create a new entry in ldap's active directory of a windows 2000 server:

Guide me on this error:

Create failed: javax.naming.NoPermissionException: [LDAP: error code 50 - Insufficient 'add' privilege to add the entry 'ou=Fruits,o=NetscapeRoot'.
]; remaining name 'ou=Fruits'

The code executed:
class Create {
public static void main(String[] args) {

// Set up the environment for creating the initial context
Hashtable env = new Hashtable(11);
env.put(Context.PROVIDER_URL, "ldap://");

try {
// Create the initial context
DirContext ctx = new InitialDirContext(env);

// Create attributes to be associated with the new context
Attributes attrs = new BasicAttributes(true); // case-ignore
Attribute objclass = new BasicAttribute("objectclass");

// Create the context
Context result = ctx.createSubcontext("ou=Fruits", attrs);

// Check that it was created by listing its parent
NamingEnumeration list = ctx.list("");

// Go through each item in list
while (list.hasMore()) {
NameClassPair nc = (NameClassPair);

// Close the contexts when we're done
} catch (NamingException e) {
System.out.println("Create failed: " + e);

Jesu Mani
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!