tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bill Gibbs <bgi...@edurotech.com>
Subject Realm Authentication lost when tomcat is restarted
Date Fri, 05 Apr 2002 14:12:16 GMT
I have a JDBCRealm setup that works great.  I can log in, it protects the 
resource I specified.

But when I stop, then start tomcat, I lose the authentication and have to 
relogin.

Looking at the log, I do see that my session was restored properly.

I ensured that PersistentManager was set to saveOnRestart=true

Tomcat ver 4.0.3.
RedHat Linux 7.2
FileStore sessions

server.xml:

        <Context path="/field_inspections_app" 
docBase="field_inspections_app" debug="99" reloadable="true">

                <Realm className="org.apache.catalina.realm.JDBCRealm" 
debug="99" driverName="org.gjt.mm.mysql.Driver" connectionName="USERNAME" 
connectionPassword="PASSWORD" digest="SHA1" 
connectionURL="jdbc:mysql://localhost/DATABASE" userTable="User" 
userNameCol="Username" userCredCol="Password" userRoleTable="UserRole" 
roleNameCol="Privilege"/>

                <Logger className="org.apache.catalina.logger.FileLogger" 
prefix="field_inspections_app." suffix=".txt" timestamp="true"/>

                <Manager 
className="org.apache.catalina.session.PersistentManager" debug="99" 
saveOnRestart="true" maxActiveSessions="-1" minIdleSwap="-1" maxIdleSwap="-1" 
maxIdleBackup="-1">
                        <Store 
className="org.apache.catalina.session.FileStore"/>
                </Manager>
        </Context>

web.xml:

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>

        <security-constraint>
                <display-name>Staff</display-name>
                        <web-resource-collection>
                                <web-resource-name>Staff Protected 
Area</web-resource-name>
                                 <!-- Define the context-relative URL(s) to 
be protected -->
                                 <url-pattern>/staff/*</url-pattern>
                        </web-resource-collection>
                <auth-constraint>
                <!-- Anyone with one of the listed roles may access this area 
-->
                        <role-name>Staff</role-name>
                </auth-constraint>
        </security-constraint>

        <!-- Default login configuration uses form-based authentication -->
        <login-config>
                <auth-method>FORM</auth-method>
                <realm-name>Staff Authentication Area</realm-name>
                <form-login-config>
                        <form-login-page>/staff/login.jsp</form-login-page>
                        <form-error-page>/staff/login.jsp</form-error-page>
                </form-login-config>
        </login-config>

</web-app>

-- 
Bill "Elvis" Gibbs
Eduro Technologies, Inc.
main 240-529-2000 | fax 301-662-9552 | cell 301-748-5418

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message