Spring security Spring LDAP异常-未注册UserDetails服务

Spring security Spring LDAP异常-未注册UserDetails服务,spring-security,spring-ldap,Spring Security,Spring Ldap,我正在尝试对JSF网站使用SpringSecurity3.0.2LDAP身份验证。当我在applicationContext-security.xml中使用下面的配置时,我得到了一个异常-org.springframework.beans.factory.BeanCreationException:创建名为“org.springframework.security.web.authentication.rememberme.tokenbasedrembermeservices#0”的bean时出

我正在尝试对JSF网站使用SpringSecurity3.0.2LDAP身份验证。当我在applicationContext-security.xml中使用下面的配置时,我得到了一个异常-org.springframework.beans.factory.BeanCreationException:创建名为“org.springframework.security.web.authentication.rememberme.tokenbasedrembermeservices#0”的bean时出错:bean初始化失败;嵌套异常为org.springframework.context.ApplicationContextException:未注册UserDetails服务

。如果不添加此项,为什么会出现上述异常?我不喜欢这种解决方法,因为我需要在两个地方编写用户搜索过滤器属性

附:我查过了。例外情况不同,我猜Spring安全版本也不同。

我怀疑您稍后在安全上下文中设置了
。根据文件:

如果您使用的身份验证提供程序不使用 UserDetailsService(例如,LDAP提供程序)则无法工作 除非应用程序中还有UserDetailsService bean 上下文

<authentication-manager>
    <ldap-authentication-provider
        user-search-filter="(uid={0})" user-search-base="ou=users,ou=system"
        group-search-base="ou=groups,ou=system">
    </ldap-authentication-provider>
</authentication-manager>

<ldap-server id="ldapServer" url="ldap://localhost:10389"
    root="" />
<ldap-user-service server-ref="ldapServer" user-search-filter="(uid={0})" />