tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Len Popp" <>
Subject Re: Possible to send 503 status over JK?
Date Wed, 26 Jul 2006 01:26:10 GMT
The recent messages on this topic have confused me, so I've spent part
of my evening running some tests.
First, with Tomcat standalone:

Tomcat's default error pages can be overridden by an error-page
declaration in the webapp's web.xml. If there is no error-page
declared, Tomcat uses its default error page; it does *not* fall back
to a "global" error page declared in the ROOT webapp.

When a webapp is stopped, its error pages are not executed
(obviously), so Tomcat's default error pages are used.

Therefore it is not possible to override the 503 page when the webapp
is stopped. Tomcat always uses its default page.

In any case, the correct HTTP status code is returned to the browser.
With Tomcat behind Apache and mod_jk:

As long as Tomcat is running, the situation is the same as above. JK
and Apache pass Tomcat's error pages and status codes back unchanged.
ErrorDocument declarations do not override Tomcat's error pages.

When Tomcat is down (not just one webapp stopped, but Tomcat not
running at all), you obviously don't get a Tomcat error page. Apache
generates the 503 error and uses its own error page. This page can be
overridden by ErrorDocument.

Again, the correct HTTP status codes are returned to the browser.

So, you can use a custom ErrorDocument to return a "Site Down" message
if Tomcat is down completely, but not if a webapp inside Tomcat is

These tests were done with Tomcat 5.5.17, Apache 2.0.55, JK 1.2.15.

On 7/25/06, Hassan Schroeder <> wrote:
> On 7/25/06, Rick G <> wrote:
> > The 500 is caught correctly, but I always end up seeing the tomcat generated
> > error page for a 503.
> > I guess this could be a mod_jk or apache issue if you are saying that tomcat
> > is sending the right status code.
> >
> > Questions:
> >  what version of tomcat you running?
> that quick test was on 5.5.17 standalone just to confirm the correct
> http header was being sent.
> --
> Hassan Schroeder ------------------------
> ---------------------------------------------------------------------
> To start a new topic, e-mail:
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message