Buggy code:
public class ContextManager { private StringManager sm = StringManager . getManager ( "org.apache.tomcat.core" ) ; private Vector requestInterceptors = new Vector ( ) ; private Vector contextInterceptors = new Vector ( ) ; ContextInterceptor [ ] cInterceptors ; RequestInterceptor [ ] rInterceptors ; Vector connectors = new Vector ( ) ; private Vector contextsV = new Vector ( ) ; int debug = 0 ; String workDir ; String home ; String installDir ; public static final String DEFAULT_WORK_DIR = "work" ; public ContextManager ( ) { } public void setHome ( String home ) { } public String getHome ( ) { } public String getInstallDir ( ) { } public void setInstallDir ( String tH ) { } public void setWorkDir ( String wd ) { } public String getWorkDir ( ) { } public void setDefaults ( ) { } public void init ( ) throws TomcatException { } public void shutdown ( ) throws TomcatException { } public void initContext ( Context ctx ) throws TomcatException { } public void shutdownContext ( Context ctx ) throws TomcatException { } public void start ( ) throws Exception { } public void stop ( ) throws Exception { } public Enumeration getContexts ( ) { } public void addContext ( Context ctx ) throws TomcatException { } public void removeContext ( Context context ) throws TomcatException { } public void addContainer ( Container container ) throws TomcatException { } 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 initRequest ( Request req , Response resp ) { } public void service ( Request rrequest , Response rresponse ) { } public int processRequest ( Request req ) { } public 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 ) { } public Request createRequest ( Context ctx , String urlPath ) { } public Request createRequest ( String urlPath ) { } public void handleStatus ( Request req , Response res , int code ) { } void handleError ( Request req , Response res , Throwable t ) { } private void callInternalError ( Request req , Response res , Context ctx , ServletWrapper errorServlet , String errorPath ) { req . setAttribute ( "tomcat.servlet.error.request" , req ) ; if ( ( errorPath == null ) && ( errorServlet == null ) ) { req . setAttribute ( "tomcat.servlet.error.defaultHandler" , "true" ) ; errorServlet = ctx . getServletByName ( "tomcat.errorPage" ) ; } if ( ( errorServlet == null ) && ( errorPath != null ) ) { try { <START_BUG> RequestDispatcher rd = ctx . getRequestDispatcher ( errorPath ) ; <END_BUG> 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 ) { ctx . log ( ( ( ( "Error//loop<seq2seq4repair_space>in<seq2seq4repair_space>default<seq2seq4repair_space>error<seq2seq4repair_space>handler<seq2seq4repair_space>" + req ) + "<seq2seq4repair_space>" ) + errorPath ) ) ; return ; } if ( ( ctx . getDebug ( ) ) > 0 ) ctx . log ( ( "Error:<seq2seq4repair_space>Calling<seq2seq4repair_space>servlet<seq2seq4repair_space>" + errorServlet ) ) ; req . setAttribute ( "tomcat.servlet.error.handler" , errorServlet ) ; errorServlet . handleRequest ( req , res ) ; return ; } private ServletWrapper doubleError ( Context ctx , Request req ) { } void handleError ( Request req , Response res , Throwable t , int code ) { } private int [ ] noteId = new int [ 3 ] ; public static final int MAX_NOTES = 32 ; public static final int SERVER_NOTE = 0 ; public static final int CONTAINER_NOTE = 1 ; public static final int REQUEST_NOTE = 2 ; String [ ] [ ] noteName = new String [ 3 ] [ ContextManager . MAX_NOTES ] ; public synchronized int getNoteId ( int noteType , String name ) throws TomcatException { } public String getNoteName ( int noteType , int noteId ) { } Object [ ] notes = new Object [ ContextManager . MAX_NOTES ] ; public void setNote ( int pos , Object value ) { } public Object getNote ( int pos ) { } boolean firstLog = true ; Logger cmLog = null ; public void addLogger ( Logger logger ) { } public void setDebug ( int level ) { } public int getDebug ( ) { } public final void log ( String msg ) { } public final void doLog ( String msg ) { } public final void doLog ( String msg , Throwable t ) { } public static final int ACC_INIT_START = 0 ; public static final int ACC_INIT_END = 0 ; public static final int ACCOUNTS = 7 ; long [ ] accTable = new long [ ContextManager . ACCOUNTS ] ; public void setAccount ( int pos , long value ) { } public long getAccount ( int pos ) { } public static final String DEFAULT_HOSTNAME = "localhost" ; public static final int DEFAULT_PORT = 8080 ; String hostname ; int port ; public void setPort ( int port ) { }

Fix:
RequestDispatcher rd = ctx . getFacade ( ) . getRequestDispatcher ( errorPath ) ;