tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <>
Subject [tomcat4] Basic Authentication problem
Date Mon, 14 Jan 2002 22:58:12 GMT

I am trying to add basic authentication for a servlet. This should be a
simple task and I'm quite sure I'm doing something stupid ... but I'm
failing to find the reason (note: I have it working on Tomcat 3.3).

I'm getting a 401 error.

I have the following directory structure :

  |_ conf
    |_ tomcat-users.xml
    |_ web.xml
    |_ server.xml
  |_ webapps
    |_ mywebapp.war

My server.xml is :

<Server port="8005" shutdown="SHUTDOWN" debug="0">
  <Service name="Tomcat-Standalone">
               port="8080" minProcessors="5" maxProcessors="75"
               acceptCount="10" debug="0"/>
    <Engine name="Standalone" defaultHost="localhost" debug="0">
      <Realm className="org.apache.catalina.realm.MemoryRealm" />
      <Host name="localhost" debug="0" appBase="full path to

My tomcat-users.xml is :

  <user name="testuser" password="testpwd" roles="test" />

And my web.xml in mywebapp.war is :



         	<description>Protect the Cactus redirector
         	<description>Authorized Users Group</description>


		<description>Test role</description>

I am starting Tomcat as follows in Ant (where ${out.tomcat40.full.dir}"
point to the absolute path to <myroot> and ${tomcat.home.40} to where
Tomcat 4 is installed) :
        <java classname="org.apache.catalina.startup.Bootstrap"
            <jvmarg value="-Dcatalina.home=${tomcat.home.40}"/>
            <arg value="-config"/>
            <arg value="${out.tomcat40.full.dir}/conf/server.xml"/>
            <arg value="start"/>

              <!-- This is to allow the use of -Dbuild.sysclasspath=only
                   starting Ant - Meaning that all jars need to be on
                   initial classpath -->
              <pathelement path="${java.class.path}"/>

              <!-- These are ignore if -Dbuild.sysclasspath=only is used
              <fileset dir="${tomcat.home.40}">
                  <include name="bin/bootstrap.jar"/>
                  <include name="server/catalina.jar"/>

Any idea ?

To unsubscribe:   <>
For additional commands: <>
Troubles with the list: <>

View raw message