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
Hi,

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 java.io.IOException: connection closed]; remaining name 'cn=Users,dc=FDSTest,dc=com'
at com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:1974)
at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1819)
at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1744)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search
(PartialCompositeDirContext.java:338)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search (PartialCompositeDirContext.java:321)
at javax.naming.directory.InitialDirContext.search(InitialDirContext.java:248)
at org.apache.catalina.realm.JNDIRealm.getUserBySearch(JNDIRealm.java:1051)
at org.apache.catalina.realm.JNDIRealm.getUser(JNDIRealm.java:959)
at org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:908)
at org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:809)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:258)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:417)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException: connection closed
at com.sun.jndi.ldap.LdapClient.ensureOpen(LdapClient.java:1558)
at com.sun.jndi.ldap.LdapClient.search(LdapClient.java:504)
at com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:1957)

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 (LdapClient.java and LdapCtx.java) 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.

Regards,
Kotler Eyal