【发布时间】:2018-01-26 07:31:02
【问题描述】:
迁移到 Spring security 4.2.2(从 3.1)后,我在 LDAP 用户搜索中遇到以下错误:
java.lang.ClassCastException: com.sun.jndi.ldap.LdapCtx cannot be cast to org.springframework.ldap.core.DirContextAdapter
at org.springframework.security.ldap.SpringSecurityLdapTemplate.searchForSingleEntryInternal(SpringSecurityLdapTemplate.java:345)
at org.springframework.security.ldap.SpringSecurityLdapTemplate$3.executeWithContext(SpringSecurityLdapTemplate.java:318)
at org.springframework.ldap.core.LdapTemplate.executeWithContext(LdapTemplate.java:817)
at org.springframework.ldap.core.LdapTemplate.executeReadOnly(LdapTemplate.java:803)
at org.springframework.security.ldap.SpringSecurityLdapTemplate.searchForSingleEntry(SpringSecurityLdapTemplate.java:316)
at org.springframework.security.ldap.search.FilterBasedLdapUserSearch.searchForUser(FilterBasedLdapUserSearch.java:127)
...
...
对于解决问题的任何帮助,我将不胜感激。如果有什么不同,我正在使用 OpenLDAP 服务器进行测试。
谢谢, 拉古
【问题讨论】:
标签: spring-security spring-ldap