I have attached a patch that corrects this problem for me.
Please try it out and see if it works for you so that a committer can
apply it.
This is a patch against the current 3.2 branch for the ContextManager.
Happy Holidays!
Shawn
Klaus Friedel wrote:
> Tomcat 3.2.1 fails to deliver a resource, if no root-context is defined in
>serverl.xml.
> If you do not define the root-context "" in server.xml and request a non-existing
>resource,
> Tomcat will loop forever in PrefixMapper.getLongestPrefixMatch() trying to find a
>Container for "".
>
> Bye,
> Klaus.
--
Shawn McMurdo mailto:[EMAIL PROTECTED]
Lutris Technologies http://www.lutris.com
Enhydra.Org http://www.enhydra.org
Title: Not found!
Index: ContextManager.java
===================================================================
RCS file: /home/cvspublic/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
retrieving revision 1.100.2.19
diff -c -r1.100.2.19 ContextManager.java
*** ContextManager.java 2000/11/16 18:25:21 1.100.2.19
--- ContextManager.java 2000/12/24 01:57:28
***************
*** 1015,1020 ****
--- 1015,1043 ----
Context ctx = req.getContext();
if(ctx==null) ctx=getContext("");
+ // XXX We handle this case specially
+ if (ctx == null) {
+ try {
+ res.setContentType("text/html");
+ String body = "
Not found!
";
+ res.setContentLength(body.length());
+ if (res.isUsingStream()) {
+ ServletOutputStream out = res.getOutputStream();
+ out.print(body);
+ out.flush();
+ } else {
+ PrintWriter out = res.getWriter();
+ out.print(body);
+ out.flush();
+ }
+ return;
+ } catch (IOException ioe) {
+ // XXX ignore, we tried
+ //ioe.printStackTrace();
+ return;
+ }
+ }
+
// don't log normal cases ( redirect and need_auth ), they are not
// error
// XXX this log was intended to debug the status code generation.