Spring LDAP连接异常解决

来源:互联网 发布:网店代运营知乎 编辑:程序博客网 时间:2024/06/03 04:44

在整理spring LDAP时发现一直报如下异常

private static final LdapTemplate template;static {        LdapContextSource cs = new LdapContextSource();        cs.setUrl("ldap://172.18.254.210:389");        cs.setBase("DC=hans,DC=com");        cs.setUserDn("administrator@hans.com");//账号        cs.setPassword("123456");//密码        cs.afterPropertiesSet();//异常就是此处未设置造成的        template = new LdapTemplate(cs);



此异常基本上就是账号密码错误导致的,检查账号密码是否正确


原创粉丝点击