Posted By:
Anonymous
Posted On:
Monday, April 29, 2002 04:40 AM
This is the error I keep getting [LDAP: error code 32 - parent does not exist]; remaining name 'dc=may,dc=ie' I'm having a problem with this everytime, can anyone tell me how I can fix this error? Is it to do with my suffix root? // Adding an object to an LDAP server import java.util.Hashtable; import java.util.Enumeration; import javax.naming.*; import javax.naming.directory.*; public class JNDIAdd { public static void main(String args[]) { try { // Hashtable for environmental information Hashtable env = new Hashtable(); System.out.println("Create initial context..."); env.put(Context.INITIAL_CONTEXT_FACTORY, "co
More>>
This is the error I keep getting [LDAP: error code 32 - parent does not exist]; remaining name 'dc=may,dc=ie'
I'm having a problem with this everytime, can anyone tell me how I can fix this error? Is it to do with my suffix root?
// Adding an object to an LDAP server
import java.util.Hashtable;
import java.util.Enumeration;
import javax.naming.*;
import javax.naming.directory.*;
public class JNDIAdd {
public static void main(String args[]) {
try {
// Hashtable for environmental information
Hashtable env = new Hashtable();
System.out.println("Create initial context...");
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://localhost/dc=may,dc=ie");
env.put(Context.SECURITY_PRINCIPAL, "cn=Keith,dc=may,dc=ie");
env.put(Context.SECURITY_CREDENTIALS, "optilab");
System.out.println("Create initial context...Done");
// Get a reference to a directory context
DirContext ctx = new InitialDirContext(env);
System.out.println("Context : "+ctx.getNameInNamespace());
Person p = new Person("galby","Keith","Galbraith","ou=People","cs@cs");
ctx.bind("dc=may,dc=ie",p);
System.out.println("Keith Galbraith has been added");
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
}
<<Less