You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by nj...@speakeasy.net on 2002/06/16 21:42:16 UTC

Troubles with with Embedded 4.1 ?

Hi,
I've been running webapps fine in my software using the Embedded class in version 4.1. However, since I tried adding a <login-config> to my web.xml, I've been getting extremely strange behavior. Before continuing, I should add that I've tried my .war file with the same web.xml in a regular Tomcat install and it works fine.

For example, if I try using BASIC <auth-method>, the browser never even shows the login window. Instead, I immediately get this error message in the log:

HttpProcessor[8080][4] process.invokeInvalid user ID

If I use FORM <auth-method>, the login works semi-ok, except that when the login is successful, the browser goes to an image file in one of the frames of my login page, rather than to the designated <welcome-file>. Also, entering the login page via the back button, and then pressing the submit button, causes an error saying that it cannot find the page "j_security_check", which as we all know is not a page but the standard script name for using form logins in the servlet spec.

Again, I've used this .war and web.xml in a standard Tomcat 4.1 install and all authentication worked fine. My embedded server does have access to a default web.xml. My app is in a .war file called admin.war. Finally, I should mention that I'm using my own custom Realm implementation, but I don't think this matters - all the problems seem to happen before the Realm's methods are invoked.

Any help in this dept. is appreciated. Below, I'm posting my web.xml file.

Thanks again for any help!
-noah

<?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>
	<!-- Admin Controller Servlet   -->
	<servlet>
		<servlet-name>Controller</servlet-name>
		<servlet-class>com.acme.admin.web.Controller</servlet-class>
	</servlet>
	<!-- The mapping for the Admin Controller Servlet -->
	<servlet-mapping>
		<servlet-name>Controller</servlet-name>
		<url-pattern>*.ctrl</url-pattern>
	</servlet-mapping>
	<!-- Session Timeout is 15 minutes -->
	<session-config>
		<session-timeout>15</session-timeout>
	</session-config>
	<!-- Welcome file is main.html -->
	<welcome-file-list>
		<welcome-file>main.html</welcome-file>
	</welcome-file-list>
	<!-- LOGIN CONSTRAINTS -->
	<security-constraint>
		<web-resource-collection>
			<web-resource-name>Admin App</web-resource-name>
			<url-pattern>/*</url-pattern>
			<http-method>GET</http-method>
			<http-method>POST</http-method>
		</web-resource-collection>
		<auth-constraint>
			<role-name>Admin</role-name>
		</auth-constraint>
	</security-constraint>
         
        <!-- BASIC login -->
	<login-config>
		<auth-method>BASIC</auth-method>
		<realm-name>Admin App</realm-name>
	</login-config>

        <!-- FORM login - commented out -->
        <!--
	<login-config>
		<auth-method>FORM</auth-method>
                <form-login-config>
                  <form-login-page>/login.html</form-login-page>
                  <form-error-page>/loginfailed.html</form-error-page>
                </form-login-config>
	</login-config>
        -->
        
	<security-role>
		<role-name>Admin</role-name>
	</security-role>
</web-app>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>