You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2003/05/25 03:05:24 UTC

DO NOT REPLY [Bug 20219] New: - mod_jk 500 errors

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20219>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20219

mod_jk 500 errors

           Summary: mod_jk 500 errors
           Product: Tomcat 4
           Version: 4.1.24
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Connector:JK/AJP (deprecated)
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: james@squish.net


Enclosed is a patch for mod_jk to give Apache 1.3 an additional string for 
displaying in standard 500 error messages when Tomcat cannot be contacted.

I'm certain that the function below could be used in mod_jk2 and that Apache 2 
can't be much different.

The message reads "The mod_jk connector was unable handle the request for 
<URI>.  This may mean an application server could not be contacted to service 
this request. Please try again later."

This is much better than the average "internal server error", especially for 
system administrators who have to administer other user's Tomcat instances.

--- jk/native/apache-1.3/mod_jk.c.orig  Mon Sep 23 10:24:34 2002
+++ jk/native/apache-1.3/mod_jk.c       Thu Oct  3 19:32:18 2002
@@ -1490,6 +1490,23 @@
     {NULL}
 };

+static int jk_error(request_rec *r)
+{
+    ap_table_setn(r->notes, "error-notes", ap_pstrcat(r->pool,
+        "<p>The mod_jk connector was unable handle the request for ",
+        "<em><a href=\"", ap_escape_uri(r->pool, r->uri), "\">",
+        ap_escape_html(r->pool, r->uri), "</a></em></p>\n",
+        "<p>This may mean an application server could not be contacted to "
+        "service this request. Please try again later.", NULL));
+
+    /* Allow "error-notes" string to be printed by ap_send_error_response() */
+    ap_table_setn(r->notes, "verbose-error-to", ap_pstrdup(r->pool, "*"));
+
+    r->status_line = ap_psprintf(r->pool, "%3.3u mod_jk error",
+                                 HTTP_INTERNAL_SERVER_ERROR);
+    return HTTP_INTERNAL_SERVER_ERROR;
+}
+
 /* ====================================================================== */
 /* The JK module handlers                                                 */
 /* ====================================================================== */
@@ -1591,7 +1607,7 @@
         }
     }

-    return HTTP_INTERNAL_SERVER_ERROR;
+    return jk_error(r);
 }

 /*

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org