Buggy code:
public void removeContainer ( Container container ) throws TomcatException { } public synchronized void addServerConnector ( ServerConnector con ) { } public Enumeration getConnectors ( ) { } public void addRequestInterceptor ( RequestInterceptor ri ) { } public RequestInterceptor [ ] getRequestInterceptors ( ) { } public void addContextInterceptor ( ContextInterceptor ci ) { } public ContextInterceptor [ ] getContextInterceptors ( ) { } public void addLogger ( Logger logger ) { } public String getHome ( ) { } public String getTomcatHome ( ) { } public void setTomcatHome ( String tH ) { } static String getCanonicalPath ( String name ) { } public void setHome ( String home ) { } public void setPort ( int port ) { } public int getPort ( ) { } public void setHostName ( String host ) { } public String getHostName ( ) { } public void setWorkDir ( String wd ) { } public String getWorkDir ( ) { } public void service ( Request rrequest , Response rresponse ) { } int processRequest ( Request req ) { } int authenticate ( Request req , Response res ) { } int authorize ( Request req , Response res ) { } int doBeforeBody ( Request req , Response res ) { } int doBeforeCommit ( Request req , Response res ) { } int doAfterBody ( Request req , Response res ) { } void handleError ( Request req , Response res , Throwable t , int code ) { Context ctx = req . getContext ( ) ; if ( ctx == null ) { ctx = getContext ( "" ) ; } if ( ( ctx . getDebug ( ) ) > 4 ) ctx . log ( ( ( ( ( ( "In<seq2seq4repair_space>error<seq2seq4repair_space>handler<seq2seq4repair_space>" + code ) + "<seq2seq4repair_space>" ) + t ) + "<seq2seq4repair_space>//<seq2seq4repair_space>" ) + req ) ) ; String path = null ; ServletWrapper errorServlet = null ; if ( ( code != 0 ) && ( code < 400 ) ) { errorServlet = ctx . getServletByName ( "tomcat.errorPage" ) ; } else if ( ( ( req . getAttribute ( "javax.servlet.error.status_code" ) ) != null ) || ( ( req . getAttribute ( "javax.servlet.error.exception_type" ) ) != null ) ) { if ( ( ctx . getDebug ( ) ) > 0 ) ctx . log ( ( ( ( "Error:<seq2seq4repair_space>exception<seq2seq4repair_space>inside<seq2seq4repair_space>exception<seq2seq4repair_space>servlet<seq2seq4repair_space>" + ( req . getAttribute ( "javax.servlet.error.status_code" ) ) ) + "<seq2seq4repair_space>" ) + ( req . getAttribute ( "javax.servlet.error.exception_type" ) ) ) ) ; errorServlet = ctx . getServletByName ( "tomcat.errorPage" ) ; } if ( t == null ) { if ( code == 0 ) code = res . getStatus ( ) ; if ( code >= 400 ) path = ctx . getErrorPage ( code ) ; if ( code == ( HttpServletResponse . SC_UNAUTHORIZED ) ) { if ( errorServlet == null ) errorServlet = ctx . getServletByName ( "tomcat.authServlet" ) ; if ( ( ctx . getDebug ( ) ) > 0 ) ctx . log ( ( "Setting<seq2seq4repair_space>auth<seq2seq4repair_space>servlet<seq2seq4repair_space>" + errorServlet ) ) ; } req . setAttribute ( "javax.servlet.error.status_code" , new Integer ( code ) ) ; } else { Class clazz = t . getClass ( ) ; while ( ( path == null ) && ( clazz != null ) ) { String name = clazz . getName ( ) ; path = ctx . getErrorPage ( name ) ; clazz = clazz . getSuperclass ( ) ; } req . setAttribute ( "javax.servlet.error.exception_type" , t . getClass ( ) ) ; req . setAttribute ( "javax.servlet.error.message" , t . getMessage ( ) ) ; req . setAttribute ( "tomcat.servlet.error.throwable" , t ) ; } req . setAttribute ( "tomcat.servlet.error.request" , req ) ; if ( ( path == null ) && ( errorServlet == null ) ) { req . setAttribute ( "tomcat.servlet.error.defaultHandler" , "true" ) ; errorServlet = ctx . getServletByName ( "tomcat.errorPage" ) ; } if ( ( errorServlet == null ) && ( path != null ) ) { try { RequestDispatcher rd = ctx . getRequestDispatcher ( path ) ; res . reset ( ) ; if ( code >= 400 ) { res . setStatus ( code ) ; } if ( res . isBufferCommitted ( ) ) { rd . include ( req . getFacade ( ) , res . getFacade ( ) ) ; } else { rd . forward ( req . getFacade ( ) , res . getFacade ( ) ) ; } return ; } catch ( Throwable t1 ) { ctx . log ( ( "<seq2seq4repair_space>Error<seq2seq4repair_space>in<seq2seq4repair_space>custom<seq2seq4repair_space>error<seq2seq4repair_space>handler<seq2seq4repair_space>" + t1 ) ) ; } } if ( ( ( req . getAttribute ( "tomcat.servlet.error.handler" ) ) != null ) && ( code >= 400 ) ) { ctx . log ( ( ( ( ( ( ( ( "Error//loop<seq2seq4repair_space>in<seq2seq4repair_space>default<seq2seq4repair_space>error<seq2seq4repair_space>handler<seq2seq4repair_space>" + req ) + "<seq2seq4repair_space>" ) + code ) + "<seq2seq4repair_space>" ) + t ) + "<seq2seq4repair_space>" ) + path ) ) ; } else { if ( ( ctx . getDebug ( ) ) > 0 ) ctx . log ( ( "Error:<seq2seq4repair_space>Calling<seq2seq4repair_space>servlet<seq2seq4repair_space>" + errorServlet ) ) ; req . setAttribute ( "tomcat.servlet.error.handler" , errorServlet ) ; <START_BUG> errorServlet . handleRequest ( req . getFacade ( ) , res . getFacade ( ) ) ; <END_BUG> } return ; } Request createRequest ( Context ctx , String urlPath ) { } Request createRequest ( String urlPath ) { } public void initRequest ( Request req , Response resp ) { } public void setDebug ( int level ) { } public int getDebug ( ) { } public final void log ( String msg ) { } boolean firstLog = true ; Logger cmLog = null ; public final void doLog ( String msg ) { } public final void doLog ( String msg , Throwable t ) { } }

Fix:
errorServlet . handleRequest ( req , res ) ;