Win a copy of Programming with Types this week in the Angular and TypeScript forum
or The Design of Web APIs in the Web Services forum!
  • 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
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • 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 ]
 
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!