tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Erdmann>
Subject Internal Server Error, ErrorDocument does not work using mod_jk2 and servlet engine stopped
Date Thu, 30 Oct 2003 08:37:11 GMT

how can I customize Apache's error page if mod_jk2 does not get a usable
worker (Tomcat is down)?

Using Apache 2.0.47, mod_jk2 2.0.2 and Tomcat 4.1.24 running on Linux I
get an error message when the servlet engine is stopped (Tomcat is

The servlet container is temporary unavailable or being upgraded
Internal Server Error

The server encountered an internal error or misconfiguration and was
unable to complete your request.

Please contact the server administrator, and inform
them of the time the error occurred, and anything you might have done
that may have caused the error.

More information about this error may be available in the server error

Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.

httpd.conf defines:

ErrorDocument 500 /error/HTTP_INTERNAL_SERVER_ERROR.html.var

This document (HTTP_INTERNAL_SERVER_ERROR.html.var) is shown when I try
to execute a CGI script missing its x-bit in filesystem access rights.

The first sentence ("The servlet container is temporary unavailable or
being upgraded") comes from mod_jk2

#define NO_WORKER_MSG "The servlet container is temporary unavailable or
being upgraded\n";

The next paragraphs are hardcoded into Apache
(httpd-2.0.47/modules/http/http_protocol.c, get_canned_error_string()):

     default:                    /* HTTP_INTERNAL_SERVER_ERROR */
          * This comparison to expose error-notes could be modified to
          * use a configuration directive and export based on that
          * directive.  For now "*" is used to designate an error-notes
          * that is totally safe for any user to see (ie lacks paths,
          * database passwords, etc.)
         if (((error_notes = apr_table_get(r->notes,
                                           "error-notes")) != NULL)
             && (h1 = apr_table_get(r->notes, "verbose-error-to")) !=
             && (strcmp(h1, "*") == 0)) {
             return(apr_pstrcat(p, error_notes, "<p />\n", NULL));
         else {
                                "<p>The server encountered an internal "
                                "error or\n"
                                "misconfiguration and was unable to
                                "your request.</p>\n"
                                "<p>Please contact the server "
                                "administrator,\n ",
                                " and inform them of the time the "
                                "error occurred,\n"
                                "and anything you might have done that "
                                "may have\n"
                                "caused the error.</p>\n"
                                "<p>More information about this error "
                                "may be available\n"
                                "in the server error log.</p>\n",

The last sentence comes from ap_send_error_response() in

         if (recursive_error) {
             ap_rvputs_proto_in_ascii(r, "<p>Additionally, a ",

                       "\nerror was encountered while trying to use an "
                       "ErrorDocument to handle the request.</p>\n",


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message