This discussion is archived
2 Replies Latest reply: Aug 16, 2013 4:52 PM by 3a5f89ac-318a-443f-a206-0e7c55b1622a RSS

LDAP Connection closed error - "CommunicationException: connection closed"

843793 Newbie
Currently Being Moderated

I’m running my application on Tomcat 6 - Linux environment. I integrated to a MS Active Directory. The LDAP integration is done using server.xml and web.xml.

The problem is that the first login is going smooth without any problem or warning. Second login after around 10 minutes succeeded but, I get the following warning:

Oct 13, 2009 11:14:23 AM org.apache.catalina.realm.JNDIRealm authenticate

WARNING: Exception performing authentication
javax.naming.CommunicationException: connection closed [Root exception is connection closed]; remaining name 'cn=Users,dc=FDSTest,dc=com'
at com.sun.jndi.ldap.LdapCtx.doSearch(
at com.sun.jndi.ldap.LdapCtx.searchAux(
at com.sun.jndi.ldap.LdapCtx.c_search(
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(
at (
at org.apache.catalina.realm.JNDIRealm.getUserBySearch(
at org.apache.catalina.realm.JNDIRealm.getUser(
at org.apache.catalina.realm.JNDIRealm.authenticate(
at org.apache.catalina.realm.JNDIRealm.authenticate(
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11Processor.process(
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Caused by: connection closed
at com.sun.jndi.ldap.LdapClient.ensureOpen(
at com.sun.jndi.ldap.LdapCtx.doSearch(

Does anyone know if it’s a known bug? Because I encounter this behavior on several forums and I didn’t found any answer or solution for that.

I tried to find the source code for ldap.jar ( and and debug it but I couldn’t find any valid source code.
Does the source code of the ldap.jar is available?

I’ll appreciate any further information or solution for this strange behavior.

Kotler Eyal