Tomcat + LDAP issue: socket closed on connection

瘦欲@ 提交于 2020-01-06 07:08:07

问题


I'm trying to configure Tomcat to connect to an LDAP server on our network, and I'm getting the following error:

javax.naming.ServiceUnavailableException: xx.xx.xx.xx:636; socket closed at com.sun.jndi.ldap.Connection.readReply(Connection.java:419) at com.sun.jndi.ldap.LdapClient.ldapBind(LdapClient.java:340) at com.sun.jndi.ldap.LdapClient.authenticate(LdapClient.java:192) at com.sun.jndi.ldap.LdapCtx.connect(LdapCtx.java:2694)

Here is the attempted Realm:

    <Realm className="org.apache.catalina.realm.JNDIRealm" debug="99"
        connectionName="CN=username,CN=users,DC=domain-name,DC=com"
        connectionPassword="password"
        connectionURL="ldap://xx.xx.xx.xx:636"
        userPattern="CN={0},CN=users,DC=domain-name,DC=com"
        roleBase="DC=domain-name,DC=com"
        roleName="CN"
        roleSearch="CN={1}"
    />

I'm not sure why this is happening, as using Softerra LDAP Admin. works with the same login information (the same DN and password).

Edit: just figured out that JXplorer doesn't work and fails with the same error, but Softerra does not.


回答1:


Look much like a software-firewall issue. You need to configure the firewall in question to allow the particular processes (java.exe and so on) to access the port in question. I however wonder if you didn't get a security dialogue beforehand which should have asked you to allow or block the access.




回答2:


Problem was solved - we had been given bad server info.



来源:https://stackoverflow.com/questions/3601979/tomcat-ldap-issue-socket-closed-on-connection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!