tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pieter Jan Velzeboer" <velzeb...@grabowsky.com>
Subject intermitant availabilty of JNDI Realm
Date Thu, 30 Oct 2003 08:09:04 GMT
Greetings,

Im have some destinct troubles with the Tomcat JNDIRealm. The problem is 
that I need to login four times before I get authenticated. 
Has anyone else experienced the same? 

Details: Tomcat 4.1.27
LDAP: Domino 5 LDAP directory
Browser: IE

Cheers Charlie

excerpt from server.xml:
=======================

<Realm className="org.apache.catalina.realm.JNDIRealm" 
        debug="99" 
        connectionURL="ldap://ldap.domain.com" 
        userBase="o=company name" 
        userSearch="(mail={0})"/>

excerpt from web.xml:
====================

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Secure management</web-resource-name>
            <url-pattern>/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
    </security-constraint>
 
    <login-config>
        <auth-method>FORM</auth-method>
        <realm-name>Secure management</realm-name>
                                <form-login-config>
 <form-login-page>/login.jsp</form-login-page>
 <form-error-page>/error.html</form-error-page>
                                </form-login-config>
    </login-config>

login.jsp:
=========

<html>
<head>
<title>domain.com - secure management</title>
</head>
<link rel="stylesheet" type="text/css" href="sec.css" />
<body onload="document.loginForm.j_username.focus();">
<center>
<form method="POST" action='<%= response.encodeURL("j_security_check") 
%>'name="loginForm">
<table border="0" cellpadding="0" cellspacing="0" width="320" 
height="240">
<tr>
        <th colspan="5" align="center">domain.com - secure 
management<br/><br/>Please login</th>
</tr>
<tr height="25">
        <td width="50">&nbsp;</td>
        <td align="right" width="200">e-mail address:</td>
        <td width="10">&nbsp;</td>
        <td align="left"><input type="text" name="j_username" size="30" 
value=""/></td>
        <td width="10">&nbsp;</td>
</tr>
<tr height="25">
        <td width="50">&nbsp;</td>
        <td align="right" width="200">password:</td>
        <td width="10">&nbsp;</td>
        <td align="left"><input type="password" name="j_password" 
size="30" value=""/></td>
        <td width="10">&nbsp;</td>
</tr>
<tr height="30">
        <td colspan="3">&nbsp;</td>
        <td align="right"><input type="submit" value="Login"/>&nbsp;<input

type="reset" value="Reset"/></td>
        <td width="10">&nbsp;</td>
</tr>
<tr>
        <td colspan="5">&nbsp;</td>
</tr>
</table>
</form>
</center>
</body>
</html>

error.html:
==========

<html>
<head>
<title>domain.com - secure management</title>
</head>
<body>
<center>
I'm sorry the credentials you  supplied are incorrect.<br/>
</center>
</body>
</html>

output from catalina_log:
========================

(Login attempt number 1)

2003-10-27 13:02:25 JNDIRealm[Standalone]:   Searching for 
joebloggs@domain.com
2003-10-27 13:02:25 JNDIRealm[Standalone]:   base: o=company name  filter: 
(mail=joebloggs@domain.com)
2003-10-27 13:02:25 Ajp13Processor[8009][6] process: invoke
java.lang.NullPointerException
        at 
org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:793)
        at 
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:263)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:466)
        at 
org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:585)
        at java.lang.Thread.run(Thread.java:536)

(Login attempt number 2)

2003-10-27 13:04:01 JNDIRealm[Standalone]:   Searching for 
joebloggs@domain.com
2003-10-27 13:04:01 JNDIRealm[Standalone]:   base: o=company name  filter: 
(mail=joebloggs@domain.com)
2003-10-27 13:04:01 JNDIRealm[Standalone]: Exception performing 
authentication
javax.naming.CommunicationException: connection closed.  Root exception is 
java.io.IOException: connection closed
        at com.sun.jndi.ldap.LdapClient.ensureOpen(LdapClient.java:1648)
        at com.sun.jndi.ldap.LdapClient.search(LdapClient.java:594)
        at com.sun.jndi.ldap.LdapCtx.doSearch(LdapCtx.java:1921)
        at com.sun.jndi.ldap.LdapCtx.searchAux(LdapCtx.java:1783)
        at com.sun.jndi.ldap.LdapCtx.c_search(LdapCtx.java:1708)
        at 
com.sun.jndi.toolkit.ctx.ComponentDirContext.p_search(ComponentDirContext.java:368)
        at 
com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:328)
        at 
com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.search(PartialCompositeDirContext.java:313)
        at 
javax.naming.directory.InitialDirContext.search(InitialDirContext.java:238)
        at 
org.apache.catalina.realm.JNDIRealm.getUserBySearch(JNDIRealm.java:1020)
        at org.apache.catalina.realm.JNDIRealm.getUser(JNDIRealm.java:913)
        at 
org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:862)
        at 
org.apache.catalina.realm.JNDIRealm.authenticate(JNDIRealm.java:788)
        at 
org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:263)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:481)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2416)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
        at 
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
        at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
        at 
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
        at 
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java:466)
        at 
org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:585)
        at java.lang.Thread.run(Thread.java:536)

2003-10-27 13:04:01 JNDIRealm[Standalone]: Closing directory context

Any ideas?

Cheers Charlie
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message