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
,并有同样的问题。我如何在不同的基础上搜索。我编写了整个应用程序,无法解决这个问题。