Example scenario: web.xml contains the following block: ... <error-page> <error-code>java.lang.Throwable</error-code> <location>/unexpected.jsp</location> </error-page> ... This block wrongly contains "error-type" instead of "error-code". When this application is deployed the error-page is registered as the default error page because org.apache.tomcat.util.descriptor.web.ErrorPage#setErrorCode catches NumberFormatException and assumes errorCode 0. Then later when a request to a servlet is made which uses the sendError (e.g. with 404) method the page "unexpected.jsp" is displayed instead of the default 404 page. It's also related to org.apache.catalina.core.StandardHostValve#status(Request request, Response response) where it says: ... ErrorPage errorPage = context.findErrorPage(statusCode); if (errorPage == null) { // Look for a default error page errorPage = context.findErrorPage(0); } ... "context.findErrorPage(0)" returns "/unexpected.jsp" although it should return null.
Thanks for the report. This has been fixed in the following branches: - 9.0.x for 9.0.0.M10 onwards - 8.5.x for 8.5.5 onwards - 8.0.x for 8.0.37 onwards - 7.0.x for 7.0.71 onwards