[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

struts-example.war and 404 Not Found on *.do URLs



Platform: debian woody, apache 1.3.19, tomcat 3.2.3,
          struts 1.0, Java2 SDK 1.3

I'm unable to make struts-example.war, from the
Jakarta Struts 1.0 binary distribution[1] work
on my debian woody installation.  

I get "404 Not Found" on all URLs into the webapp, 
with *.do at the end (action URLs that are supposed 
to be handled by the action servlet).

The example works when running directly from Tomcat's
HTTP server, but doesn't work when running via
apache.

The installation consisted of:
 1. dropping struts-example.war into 
	/usr/share/java/webapps/
 2. adding
	DirectoryIndex index.jsp index.html
    to /etc/apache/srm.conf
 3. adding
	AddHandler jserv-servlet .do
    to /etc/apache/srm.conf
 4. adding
	JkMount /struts-example/*.do ajp12
    to a file where it won't be overwritten 
    (/etc/apache/mod_jk/tomcat-auto is overwritten
    every time tomcat is restarted).  I've put
    this line into /etc/apache/httpd.conf, after
    the inclusion of tomcat-auto
 5. restarting tomcat
 6. restarting apache

I think the problem has something to do with session
handling, and possibly something to do with how
cookies are handled/transferred between apache
and tomcat.

To illustrate what's happening:

The following URLs work:
	<http://localhost/struts-example/>
	<http://localhost/struts-example/index.jsp>
	<http://localhost/struts-example/logon.jsp>

The following URLs doesn't work:
	<http://localhost/struts-example/editRegistration.do?action=Create>
	<http://localhost/struts-example/logon.do>
	<http://localhost/struts-example/tour.do>

However, if I put a jsessionid argument on them,
even a bogus one, they will open, ie. these
URLs will work:
	
<http://localhost/struts-example/editRegistration.do;jsessionid=hello?action
=Create>
	<http://localhost/struts-example/logon.do;jsessionid=hello>
	<http://localhost/struts-example/tour.do;jsessionid=hello>

As I've taken to understand it, using ;jsessionid as
a part of the URL, is the most primitive form of 
session management.  The preferred form is cookies.

The 404 problem occurs with several browsers (IE 5.50
on Win2k, Opera 5.12 on Win2k, and Opera 5.0 on linux).
I have made cookie handling wide open on all browsers,
without any changes in behaviour.

But that was just a shot in the dark, since things
working perfectly directly with Tomcat, would seem
to indicate that the problem wasn't on the browser 
side.

I've tried logging cookies, using the CustomLog settings
described in [2], without seeing anything.  Which means
that either 
 a. struts-example.war doesn't set any cookies
or 
 b. cookies are set,... but mod_usertrack can't see them
which means that I'm basically where I started...:-)

Searches on the web, found this problem
	<http://www.dfwuug.org/~wjm/tomcat/2000/Jul/msg00001.html>
which may seem to be related.  But this was in July of
last year, and is related to Tomcat 3.2 before releas,
while I'm running 3.2.3.

Right now, I'm grepping through the Struts source code,
trying to find something interesting, but that's 
basically grasping at straws.

All hints, tips, wild ideas, etc. are welcome.  Are
there known problems with the combinations of the
versions of the tools I'm using?  Anything at all...? :-)


Thanx!


- Steinar


[1] <http://jakarta.apache.org/builds/jakarta-struts/release/v1.0/>
[2] <http://httpd.apache.org/docs/mod/mod_usertrack.html>







































 
This email, its content and any attachments is PRIVATE AND CONFIDENTIAL to
TANDBERG Television. If received in error please notify the sender and
destroy the original message and attachments.



Reply to: