aspose file tools*
The moose likes Tomcat and the fly likes Tomcat 5.5.26 LDAP Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat 5.5.26 LDAP Problem " Watch "Tomcat 5.5.26 LDAP Problem " New topic
Author

Tomcat 5.5.26 LDAP Problem

Muhammad Ghufran
Greenhorn

Joined: Jul 20, 2005
Posts: 8
Hi,

I am using tomcat 5.5.26 and JNDIRealm for validating user from LDAP. It works fine but every morning when I try to login LDAP authentication fails until I restart server. It used to work with Tomcat 4.1 since I upgraded to 5.5 I need to restart every morning to refresh the LDAP connection. I would appreciate any thoughts thanks in advance.

LDAP Configration
=================

<Realm className="org.apache.catalina.realm.JNDIRealm"connectionName="CN=XX,OU=XX,OU=XX,DC=XX,dc=XX,DC=com"
connectionPassword="xxxx"
connectionURL="ldap://xxxx.xxx.com:389"
debug="99"
referrals="follow"
roleBase="OU=HQ,DC=XX,DC=XX,DC=com"
roleName="cn" roleSearch="member={0}"
roleSubtree="true"
userBase="OU=HQ,DC=XXXX,DC=XXX,DC=com"
userRoleName="member"
userSearch="cn={0}" userSubtree="true"/>


Exception Every Morning When try to login
=========================================
Apr 29, 2008 7:37:07 AM org.apache.catalina.realm.JNDIRealm authenticate
WARNING: Exception performing authentication
Throwable occurred: javax.naming.CommunicationException: connection closed [Root exception is java.io.IOException: connection closed]; Remaining name: 'OU=HQ,DC=orchard,DC=fruit,DC=com'
at com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:1965)
at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1810)
at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1735)
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(Unknown Source)
at org.apache.catalina.realm.JNDIRealm.getUserBySearch(JNDIRealm.java:1067)
at org.apache.catalina.realm.JNDIRealm.getUser(JNDIRealm.java:975)
at org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:924)
at org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:810)
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:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
at java.lang.Thread.run(Thread.java:735)
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:1948)
... 22 more
Muhammad Ghufran
Greenhorn

Joined: Jul 20, 2005
Posts: 8
I got it solved, LDAP configration was placed in the server.xml file. I moved it to context.xml file. It fixed the issue.
[ May 01, 2008: Message edited by: Muhammad Ghufran ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat 5.5.26 LDAP Problem
 
Similar Threads
jboss jndi
LDAP Authentication with Active Directory
javax.naming.ServiceUnavailableException: cod.dc.iad.equant.com:389; socket closed; remaining name '
LDAP Search
Windows Authentication Using Tomcat 5.0