• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Tomcat 5.5.26 LDAP Problem

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!