0
我作爲春LDAP基本配置
ou=studentBase,dc=example,dc=com
在我的安全XML我有
<bean id="contextSource" class="org.springframework.ldap.core.support.LdapContextSource">
<property name="base" value="ou=studentBase,dc=example,dc=com" />
<property name="url" value="ldaps://serveraddress:port" />
<property name="userDn" value="username" />
<property name="password" value="pwd" />
</bean>
我想查詢屬性的容器對象
cn=container,cn=schema,cn=configuration,dc=example,dc=com
當目錄結構我搜索的基地設置爲
cn=container,cn=schema,cn=configuration,dc=example,dc=com
ldapTemplate.search(base, filter.encode(), new AttributesMapper()){
}
我得到一個錯誤
org.springframework.ldap.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-03100238, problem 2001 (NO_OBJECT), data 0, best match of: 'ou=studentBase,dc=example,dc=com']; nested exception is
javax.naming.NameNotFoundException: [LDAP: error code 32 - 0000208D: NameErr: DSID-03100238, problem 2001 (NO_OBJECT), data 0, best match of:
'ou=studentBase,dc=example,dc=com']; remaining name cn=container,cn=schema,cn=configuration,dc=example,dc=com
問題是我無法改變的基礎搜索比我把xml配置文件基點之外任何東西。我也嘗試SearchControls
,並有同樣的問題。我如何在不同的基礎上搜索。我編寫了整個應用程序,無法解決這個問題。