[Date Prev][Date Next] [Chronological] [Thread] [Top]

OpenLDAP with JNDI : java.naming.NameNotFoundException



Susmitha Vuyyuru writes:
 > -----------
 >         ........
 > env.put(Context.INITIAL_CONTEXT_FACTORY,
 > "com.sun.jndi.ldap.LdapCtxFactory");
 > env.put(Context.PROVIDER_URL, "ldap://localhost:389";);
 > String attrs[] = new String[1];
 > 
 > DirContext ctx=new InitialDirContext(env);
 > Attributes attr= ctx.getAttributes("cn=BB" attrs);

I think your error may be an incorrect name specification to
ctx.getAttributes(). Can you do a command line search for the same
"cn=BB"?


 >                 ........................
 > 
 > whenever I run
 > java Getattrs
 > 
 > I get the following errors:
 > 
 > Getattrs example failed
 > java.naming.NameNotFoundException: [LDAP error code 32 - No Such Object];
 > remaining name 'cn=BB
 > 	at com.jndi.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:2680)