ServiceUnavailableException Reported when Connecting to LDAP
Symptoms
When trying to connect to an LDAP Server, the following error appears in the log file:
ERROR [codehaus.xfire.handler.DefaultFaultHandler] Fault occurred!
org.springframework.ldap.ServiceUnavailableException: example.com:389; socket closed; nested exception is javax.naming.ServiceUnavailableException: example.com:389; socket closed; remaining name 'DC=sydney,DC=example,DC=com'
at org.springframework.ldap.support.LdapUtils.convertLdapException(LdapUtils.java:210)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:319)
at org.springframework.ldap.core.LdapTemplate.search(LdapTemplate.java:237)
Cause
Unknown. Investigation is being tracked at - CWD-1942Getting issue details... STATUS .
Resolution
As a workaround, add the following line to your JAVA_OPTS definition (To do this either edit or create a setenv.sh
or setenv.bat
file located in Tomcat's bin directory: apache-tomcat/bin/setenv.sh
or setenv.bat
):
-Dcom.sun.jndi.ldap.connect.pool.timeout=300000
If running Crowd as a Windows Service, please add the setting above to the Windows Registry key responsible for the Crowd Service:
HKEY_LOCAL_MACHINE -> SOFTWARE -> Apache Software Foundation -> Procrun 2.0 -> Crowd -> Parameters -> Java -> Options