PDA

View Full Version : LDAP: error code 32 - No Such Object



minakari
Aug 23rd, 2007, 05:20 AM
hello

when I tryig to insert too ldap this error occurs:

Error occured javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=Rahul, ou=People, dc=irisa, dc=com'

what can I do?
I dont now how to solve this problem.

my code is:

public void insertContact(ContactDTO contactDTO) {

Attributes personAttributes = new BasicAttributes();
BasicAttribute personBasicAttribute = new BasicAttribute("objectclass");
personBasicAttribute.add("person");
personAttributes.put(personBasicAttribute);
personAttributes.put("cn", contactDTO.getCommonName());
personAttributes.put("sn", contactDTO.getLastName());
personAttributes.put("description", contactDTO.getDescription());

DistinguishedName newContactDN = new DistinguishedName("dc=irisa,dc=com");
newContactDN.add("ou","People");
newContactDN.add("cn",contactDTO.getCommonName());

ldapTemplate.bind(newContactDN, null, personAttributes);
}

I am new in spring-ldap.

rasky
Aug 23rd, 2007, 05:28 AM
The error you get is because the server can't find the parent node of the entry you are trying to create. A likely cause for this is that you have specified a base DN in your ContextSource configuration. If you have done so, the base DN must not be included in any other DNs:


DistinguishedName newContactDN = new DistinguishedName();
newContactDN.add("ou","People");
newContactDN.add("cn",contactDTO.getCommonName());


If you have not specified a base DN in your configuration, the 'ou=People, dc=irisa, dc=com' node does not exist in your tree.

void_void
Nov 11th, 2009, 05:05 AM
i am having similar problem,
i have upper hierarical entry as to be listed i.e.o=sql,c=RU
I m facing the problem below :
nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'cn=abc,o=sql,c=RU

mschaubr
Jan 12th, 2010, 08:03 AM
I tried the suggestion and it worked for me.

Thanks!http://forum.springsource.org/images/icons/icon7.gif