【发布时间】:2017-08-12 05:25:16
【问题描述】:
我的目录结构为
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 并且遇到了同样的问题。如何在不同的基础上进行搜索。我已经编写了整个应用程序,无法解决这个问题。
【问题讨论】:
标签: java spring spring-mvc ldap jndi