I have looked around the forum and found some answers on this question, but so far the solutions have not helped.
I am referencing an LDAP server, which apparently uses Referrals. When I try to search for a node on that server, I receive the following Exception:
I then did some research, and found that I need to set referral = "follow":org.springframework.ldap.PartialResultException: [LDAP: error code 10 - 0000202B: RefErr: DSID-031006BB, data 0, 1 access points
ref 1: 'extranet.mycompany.com'
]; nested exception is javax.naming.PartialResultException: [LDAP: error code 10 - 0000202B: RefErr: DSID-031006BB, data 0, 1 access points
ref 1: 'extranet.mycompany.com'
remaining name 'cn=specops-spp-pwdReset,CN=spect7,OU=SpecOps Test,OU=Trading Partners,DC=extranet,DC=mycompany,DC=com'
My ldapTemplate:<bean id="contextSource" class="org.springframework.ldap.core.support.LdapC ontextSource">
<property name="url" value="ldap://prodldap.mycompanyco.com" />
<property name="userDn" value="CN=SVC_PORTAL_WPSBIND,OU=Portal,OU=Applicat ions,OU=Servers,DC=extranet,DC=mycompany,DC=com" />
<property name="password" value="pwd" />
<property name="pooled" value="true"/>
<property name="referral" value="follow"/>
</bean>
Code where I make the call:<bean id="ldapTemplate" class="org.springframework.ldap.core.LdapTemplate" >
<constructor-arg ref="contextSource" />
<property name="ignorePartialResultException" value="true"/>
</bean>
I have debugged the code, and I know for a fact that referrals=follow and ignorePartialResultException=truetry {
ldapTemplate.lookup(leafNode + "," + fullyQualifiedUserName);
return true;
}catch (Exception e) {
if(e instanceof NameNotFoundException){
if(logger.isDebugEnabled()){
logger.debug("Expected NameNotFoundException b/c userName's leafNode was not found. User: " + fullyQualifiedUserName);
}
return false;
}
logger.warn(e);
return false;
}
Any ideas on why I am still receiving the Exception mentioned above?
Thanks,
Sean


Reply With Quote
