Buggy code:
private int sessionTimeOut = - 1 ; private Vector welcomeFiles = new Vector ( ) ; private Hashtable errorPages = new Hashtable ( ) ; private Hashtable loadableServlets = new Hashtable ( ) ; private URL docBase ; private String path = "" ; private boolean isInvokerEnabled = false ; private File workDir = new File ( ( ( ( System . getProperty ( "user.dir" , "." ) ) + ( System . getProperty ( "file.separator" ) ) ) + ( Constants . WorkDir ) ) ) ; private boolean isWorkDirPersistent = false ; private File warDir = null ; private boolean isWARExpanded = false ; private boolean isWARValidated = false ; private Vector initInterceptors = new Vector ( ) ; private Vector serviceInterceptors = new Vector ( ) ; private Vector destroyInterceptors = new Vector ( ) ; private RequestSecurityProvider rsProvider = DefaultRequestSecurityProvider . getInstance ( ) ; public Context ( ) { } public Context ( Server server , String path ) { } public String getEngineHeader ( ) { } public String getPath ( ) { } public void setPath ( String path ) { } public boolean isInvokerEnabled ( ) { } public void setInvokerEnabled ( boolean isInvokerEnabled ) { } public void setRequestSecurityProvider ( RequestSecurityProvider rsProvider ) { } public RequestSecurityProvider getRequestSecurityProvider ( ) { } public File getWorkDir ( ) { } public void setWorkDir ( String workDir , boolean isWorkDirPersistent ) { } public void setWorkDir ( File workDir , boolean isWorkDirPersistent ) { } public boolean isWorkDirPersistent ( ) { } File getWARDir ( ) { } public boolean isWARExpanded ( ) { } public void setIsWARExpanded ( boolean isWARExpanded ) { } public boolean isWARValidated ( ) { } public void setIsWARValidated ( boolean isWARValidated ) { } public ClassLoader getClassLoader ( ) { } public void setClassLoader ( ClassLoader classLoader ) { } public String getClassPath ( ) { } public void setClassPath ( String classPath ) { } public void addInitInterceptor ( LifecycleInterceptor interceptor ) { } public void addDestroyInterceptor ( LifecycleInterceptor interceptor ) { } public void addServiceInterceptor ( ServiceInterceptor interceptor ) { } Vector getInitInterceptors ( ) { } Vector getDestroyInterceptors ( ) { } Vector getServiceInterceptors ( ) { } public synchronized void init ( ) { } public void shutdown ( ) { } public Enumeration getWelcomeFiles ( ) { } public String getInitParameter ( String name ) { } public Enumeration getInitParameterNames ( ) { } public Object getAttribute ( String name ) { } public Enumeration getAttributeNames ( ) { } public void setAttribute ( String name , Object object ) { } public void removeAttribute ( String name ) { } public URL getDocumentBase ( ) { } public void setDocumentBase ( URL docBase ) { } public String getDescription ( ) { } public void setDescription ( String description ) { } public boolean isDistributable ( ) { } public void setDistributable ( boolean isDistributable ) { } public int getSessionTimeOut ( ) { } public void setSessionTimeOut ( int sessionTimeOut ) { } public MimeMap getMimeMap ( ) { } public String getErrorPage ( int errorCode ) { } public String getErrorPage ( String errorCode ) { } public Container getContainer ( ) { } ServletContextFacade getFacade ( ) { } public void handleRequest ( Request request , Response response ) throws IOException { } private Properties getProperties ( String propertyFileName ) { } private void clearDir ( File dir ) { } private void processWebApp ( InputStream is ) { } private void processWebApp ( InputStream is , boolean internal ) { } private void processDescription ( String description ) { } private void processDistributable ( boolean isDistributable ) { } private void processInitializationParameters ( Enumeration contextParameters ) { } private void processSessionTimeOut ( int sessionTimeOut ) { } private void processServlets ( Enumeration servlets ) { } private void processMimeMaps ( Enumeration mimeMaps ) { } private void processWelcomeFiles ( Enumeration welcomeFiles ) { } private void processWelcomeFiles ( Enumeration welcomeFiles , boolean internal ) { } private void processErrorPages ( Enumeration errorPages ) { } private void loadServlets ( ) { Vector orderedKeys = new Vector ( ) ; Enumeration e = loadableServlets . keys ( ) ; while ( e . hasMoreElements ( ) ) { Integer key = ( ( Integer ) ( e . nextElement ( ) ) ) ; int slot = - 1 ; for ( int i = 0 ; i < ( orderedKeys . size ( ) ) ; i ++ ) { if ( ( key . intValue ( ) ) < ( ( ( Integer ) ( orderedKeys . elementAt ( i ) ) ) . intValue ( ) ) ) { slot = i ; break ; } } if ( slot > ( - 1 ) ) { orderedKeys . insertElementAt ( key , slot ) ; } else { orderedKeys . addElement ( key ) ; } } for ( int i = 0 ; i < ( orderedKeys . size ( ) ) ; i ++ ) { Integer key = ( ( Integer ) ( orderedKeys . elementAt ( i ) ) ) ; e = ( ( Vector ) ( loadableServlets . get ( key ) ) ) . elements ( ) ; while ( e . hasMoreElements ( ) ) { String servletName = ( ( String ) ( e . nextElement ( ) ) ) ; <START_BUG> ServletsWrapper result = container . getServletByName ( servletName ) ; <END_BUG> if ( result == null ) System . out . println ( ( "Warning:<seq2seq4repair_space>we<seq2seq4repair_space>try<seq2seq4repair_space>to<seq2seq4repair_space>load<seq2seq4repair_space>an<seq2seq4repair_space>undefined<seq2seq4repair_space>servlet<seq2seq4repair_space>" + servletName ) ) ; try { if ( result != null ) result . loadServlet ( ) ; } catch ( Exception ee ) { String msg = sm . getString ( "context.loadServlet.e" , servletName ) ; System . out . println ( msg ) ; } } } } }

Fix:
ServletWrapper result = container . getServletByName ( servletName ) ;