Hello all!
I have a bit of a problem with the ldapTemplate lookup and search methods.
This is my context:
In my LDAP (v3) I have the following entry:Code:<bean id="contextSource" class="net.sf.ldaptemplate.support.LdapContextSource"> <property name="url" value="ldap://localhost:389"/> <property name="userName" value="cn=user"/> <property name="base" value=" ou=admins,ou=teamadmin,O=TEAM.SI,C=SI"/> <property name="password" value="password"/> <property name="authenticatedReadOnly" value="true"/> </bean>
When I try:Code:uid=admin,ou=admins,ou=teamadmin, o=TEAM.SI, c=SI
i get the net.sf.ldaptemplate.EntryNotFoundException.Code:LdapUser ldapUser = (LdapUser)m_ldapTemplate.lookup("uid=" + p_username + "," + m_searchBase, mapper); //where m_searchBase== "ou=admins,ou=teamadmin,O=TEAM.SI,C=SI"
Stack:
Ideas?Code:net.sf.ldaptemplate.EntryNotFoundException: Entry not found; nested exception is javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'uid=admin,ou=admins,ou=olpadmin,O=AMEX.HR,C=HR' javax.naming.NameNotFoundException: [LDAP: error code 32 - No Such Object]; remaining name 'uid=admin,ou=admins,ou=olpadmin,O=AMEX.HR,C=HR' at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3013) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2934) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2740) at com.sun.jndi.ldap.LdapCtx.c_getAttributes(LdapCtx.java:1294) at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_getAttributes(ComponentDirContext.java:213) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:121) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.getAttributes(PartialCompositeDirContext.java:109) at javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:121) at javax.naming.directory.InitialDirContext.getAttributes(InitialDirContext.java:116) at net.sf.ldaptemplate.LdapTemplate$6.executeWithContext(LdapTemplate.java:464) at net.sf.ldaptemplate.LdapTemplate.executeWithContext(LdapTemplate.java:408) at net.sf.ldaptemplate.LdapTemplate.executeReadOnly(LdapTemplate.java:395) at net.sf.ldaptemplate.LdapTemplate.lookup(LdapTemplate.java:461)
Thanks!


Reply With Quote
