Error 32 can some help me?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

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

Re: Error 32 Solution

Posted By:   Anonymous  
Posted On:   Monday, April 29, 2002 07:40 AM


I found out the problem means that I am already inside the context so I cannot find dc=may,dc=ie inside of dc=may,dc=ie therefore the object is not found. Here is my solution:

// 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");

// Get a reference to a directory context
DirContext ctx = new InitialDirContext(env);
System.out.println("Context : "+ctx.getNameInNamespace());

//We need course, mentor, supervisors, studentnumber, classrep, subject

Student s = new Student("6","Jack","Thorton","CSSE","Andy Dowling","Paul Gibson", "789186",
"Donal Foley", "Compulsary");

ctx.bind("uid=6,ou=CSSE,ou=FirstYr,ou=FacOfScience,ou=Student",s);
System.out.println("Jack has been added");

} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
}


About | Sitemap | Contact