title: SEVERE: Context [/javaproj] startup failed due to previous errors?
body: <p>Project was running fine, i made a change some where and couldn't figure out where
  now i am not able to get it working</p>
  
  <p>Is there any thing wrong with my spring security context configuration setting??</p>
  
  <p>I couldnt find any proper documentation(beginner) in <a href="http://www.springsource.org" rel="nofollow">www.springsource.org</a></p>
  
  <p><strong>ERROR</strong></p>
  
  <p>HTTP Status 404 - /javaproj/</p>
  
  <p><strong>TOMCAT OUT:</strong></p>
  
  <pre><code>Jan 6, 2012 1:14:40 PM org.apache.catalina.core.AprLifecycleListener init
  INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_22\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\JetBrains\IntelliJ IDEA 10.5.1\bin\..\.\bin;C:\ColdFusion9\verity\k2\_nti40\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\grails-1.3.7\bin;C:\Program Files\Subversion\bin;C:\Program Files\TortoiseSVN\bin;c:\program files\jetbrains\intellij idea 10.5.1\jre\jre\bin
  Jan 6, 2012 1:14:40 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["http-bio-8080"]
  Jan 6, 2012 1:14:40 PM org.apache.coyote.AbstractProtocol init
  INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
  Jan 6, 2012 1:14:40 PM org.apache.catalina.startup.Catalina load
  INFO: Initialization processed in 428 ms
  Jan 6, 2012 1:14:40 PM org.apache.catalina.core.StandardService startInternal
  INFO: Starting service Catalina
  Jan 6, 2012 1:14:40 PM org.apache.catalina.core.StandardEngine startInternal
  INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
  Jan 6, 2012 1:14:40 PM org.apache.catalina.startup.HostConfig deployDescriptor
  INFO: Deploying configuration descriptor C:\Users\JebaPrince\.IntelliJIdea10\system\tomcat\Unnamed_javaproj_3\conf\Catalina\localhost\javaproj.xml
  Jan 6, 2012 1:14:47 PM org.springframework.web.context.ContextLoader initWebApplicationContext
  INFO: Root WebApplicationContext: initialization started
  Jan 6, 2012 1:14:47 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
  INFO: Refreshing Root WebApplicationContext: startup date [Fri Jan 06 13:14:47 IST 2012]; root of context hierarchy
  Jan 6, 2012 1:14:47 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
  INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/javaproj-app-context.xml]
  Jan 6, 2012 1:14:48 PM org.springframework.security.core.SpringSecurityCoreVersion &lt;clinit&gt;
  INFO: You are running with Spring Security Core 3.1.0.RELEASE
  Jan 6, 2012 1:14:48 PM org.springframework.security.config.SecurityNamespaceHandler &lt;init&gt;
  INFO: Spring Security 'config' module version is 3.1.0.RELEASE
  Jan 6, 2012 1:14:48 PM org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser parseInterceptUrlsForFilterInvocationRequestMap
  INFO: Creating access control expression attribute 'permitAll' for /**
  Jan 6, 2012 1:14:48 PM org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser parseInterceptUrlsForFilterInvocationRequestMap
  INFO: Creating access control expression attribute 'IS_AUTHENTICATED_ANONYMOUSLY' for /j_spring_security_check
  Jan 6, 2012 1:14:48 PM org.springframework.security.config.http.FilterInvocationSecurityMetadataSourceParser parseInterceptUrlsForFilterInvocationRequestMap
  INFO: Creating access control expression attribute 'IS_AUTHENTICATED_ANONYMOUSLY' for /Login.jsp
  Jan 6, 2012 1:14:48 PM org.springframework.security.config.http.HttpSecurityBeanDefinitionParser checkFilterChainOrder
  INFO: Checking sorted filter chain: [Root bean: class [org.springframework.security.web.context.SecurityContextPersistenceFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 300, Root bean: class [org.springframework.security.web.authentication.logout.LogoutFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 400, &lt;org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0&gt;, order = 800, Root bean: class [org.springframework.security.web.authentication.www.BasicAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1200, Root bean: class [org.springframework.security.web.savedrequest.RequestCacheAwareFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1300, Root bean: class [org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1400, Root bean: class [org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1600, Root bean: class [org.springframework.security.web.authentication.AnonymousAuthenticationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1700, Root bean: class [org.springframework.security.web.session.SessionManagementFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1800, Root bean: class [org.springframework.security.web.access.ExceptionTranslationFilter]; scope=; abstract=false; lazyInit=false; autowireMode=0; dependencyCheck=0; autowireCandidate=true; primary=false; factoryBeanName=null; factoryMethodName=null; initMethodName=null; destroyMethodName=null, order = 1900, &lt;org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0&gt;, order = 2000]
  Jan 6, 2012 1:14:48 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
  INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1021e58: defining beans [org.springframework.security.filterChains,org.springframework.security.filterChainProxy,org.springframework.security.web.DefaultSecurityFilterChain#0,org.springframework.security.web.DefaultSecurityFilterChain#1,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices#0,org.springframework.security.authentication.RememberMeAuthenticationProvider#0,org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint#0,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0,org.springframework.security.userDetailsServiceFactory,org.springframework.security.web.DefaultSecurityFilterChain#2,org.springframework.security.provisioning.InMemoryUserDetailsManager#0,org.springframework.security.authentication.dao.DaoAuthenticationProvider#0,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager]; root of factory hierarchy
  Jan 6, 2012 1:14:48 PM org.springframework.security.web.DefaultSecurityFilterChain &lt;init&gt;
  INFO: Creating filter chain: Ant [pattern='/login.jsp*'], []
  Jan 6, 2012 1:14:48 PM org.springframework.security.web.DefaultSecurityFilterChain &lt;init&gt;
  INFO: Creating filter chain: Ant [pattern='/manage**'], []
  Jan 6, 2012 1:14:48 PM org.springframework.security.web.DefaultSecurityFilterChain &lt;init&gt;
  INFO: Creating filter chain: org.springframework.security.web.util.AnyRequestMatcher@1, [org.springframework.security.web.context.SecurityContextPersistenceFilter@1ff3510, org.springframework.security.web.authentication.logout.LogoutFilter@1f4e0ba, org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter@1cdd76a, org.springframework.security.web.authentication.www.BasicAuthenticationFilter@f9a042, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@88890d, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@1ddcd5f, org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter@d642fd, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@c7f38c, org.springframework.security.web.session.SessionManagementFilter@1469bea, org.springframework.security.web.access.ExceptionTranslationFilter@a64642, org.springframework.security.web.access.intercept.FilterSecurityInterceptor@4e9b7d]
  Jan 6, 2012 1:14:48 PM org.springframework.security.config.http.DefaultFilterChainValidator checkLoginPageIsntProtected
  INFO: Checking whether login URL '/Login.jsp' is accessible with your configuration
  Jan 6, 2012 1:14:48 PM org.springframework.web.context.ContextLoader initWebApplicationContext
  INFO: Root WebApplicationContext: initialization completed in 671 ms
  Jan 6, 2012 1:14:48 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Error filterStart
  Jan 6, 2012 1:14:48 PM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/javaproj] startup failed due to previous errors
  Jan 6, 2012 1:14:48 PM org.springframework.context.support.AbstractApplicationContext doClose
  INFO: Closing Root WebApplicationContext: startup date [Fri Jan 06 13:14:47 IST 2012]; root of context hierarchy
  Jan 6, 2012 1:14:48 PM org.springframework.beans.factory.support.DefaultSingletonBeanRegistry destroySingletons
  INFO: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1021e58: defining beans [org.springframework.security.filterChains,org.springframework.security.filterChainProxy,org.springframework.security.web.DefaultSecurityFilterChain#0,org.springframework.security.web.DefaultSecurityFilterChain#1,org.springframework.security.web.PortMapperImpl#0,org.springframework.security.config.authentication.AuthenticationManagerFactoryBean#0,org.springframework.security.authentication.ProviderManager#0,org.springframework.security.web.context.HttpSessionSecurityContextRepository#0,org.springframework.security.web.authentication.session.SessionFixationProtectionStrategy#0,org.springframework.security.web.savedrequest.HttpSessionRequestCache#0,org.springframework.security.web.access.expression.DefaultWebSecurityExpressionHandler#0,org.springframework.security.access.vote.AffirmativeBased#0,org.springframework.security.web.access.intercept.FilterSecurityInterceptor#0,org.springframework.security.web.access.DefaultWebInvocationPrivilegeEvaluator#0,org.springframework.security.authentication.AnonymousAuthenticationProvider#0,org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices#0,org.springframework.security.authentication.RememberMeAuthenticationProvider#0,org.springframework.security.web.authentication.www.BasicAuthenticationEntryPoint#0,org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter#0,org.springframework.security.userDetailsServiceFactory,org.springframework.security.web.DefaultSecurityFilterChain#2,org.springframework.security.provisioning.InMemoryUserDetailsManager#0,org.springframework.security.authentication.dao.DaoAuthenticationProvider#0,org.springframework.security.authentication.DefaultAuthenticationEventPublisher#0,org.springframework.security.authenticationManager]; root of factory hierarchy
  Jan 6, 2012 1:14:48 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\apache-tomcat-7.0.23\webapps\docs
  Jan 6, 2012 1:14:48 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\apache-tomcat-7.0.23\webapps\examples
  Jan 6, 2012 1:14:48 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\apache-tomcat-7.0.23\webapps\host-manager
  Jan 6, 2012 1:14:48 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\apache-tomcat-7.0.23\webapps\manager
  Jan 6, 2012 1:14:48 PM org.apache.catalina.startup.HostConfig deployDirectory
  INFO: Deploying web application directory C:\apache-tomcat-7.0.23\webapps\ROOT
  Jan 6, 2012 1:14:48 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-8080"]
  Jan 6, 2012 1:14:48 PM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["ajp-bio-8009"]
  Jan 6, 2012 1:14:48 PM org.apache.catalina.startup.Catalina start
  INFO: Server startup in 8019 ms
  Connected to server
  </code></pre>
  
  <p><strong>Web.xml</strong></p>
  
  <p>
  </p>
  
  <pre><code>&lt;filter&gt;
      &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
      &lt;filter-name&gt;filterChainProxy&lt;/filter-name&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;filterChainProxy&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;
          /WEB-INF/javaproj-app-context.xml
      &lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;listener&gt;
      &lt;listener-class&gt;
          org.springframework.web.context.ContextLoaderListener
      &lt;/listener-class&gt;
  &lt;/listener&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;javaproj&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;javaproj&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  
  &lt;welcome-file-list&gt;
      &lt;welcome-file&gt;Login.jsp&lt;/welcome-file&gt;
  &lt;/welcome-file-list&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;K2M&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.swiftant.jsp.K2MServlet&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;K2M&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/Servlets/K2MServlet&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet-name&gt;First&lt;/servlet-name&gt;
  &lt;jsp-file&gt;/Servlets/FirstJSP.jsp&lt;/jsp-file&gt;
  
  &lt;servlet&gt;
      &lt;servlet-name&gt;AuthController&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.swiftant.jsp.AuthController&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;AuthController&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/Servlets/AuthController&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;servlet&gt;
      &lt;servlet-name&gt;UserService&lt;/servlet-name&gt;
      &lt;servlet-class&gt;com.swiftant.jsp.UserService&lt;/servlet-class&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;UserService&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/Servlets/UserService&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;DRIVER_NAME&lt;/param-name&gt;
      &lt;param-value&gt;com.mysql.jdbc.Driver&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;DATABASE_URL&lt;/param-name&gt;
      &lt;param-value&gt;jdbc:mysql://localhost/javadb&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;login_page&lt;/param-name&gt;
      &lt;param-value&gt;/Servlets/Login.jsp&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;context-param&gt;
      &lt;param-name&gt;session_time&lt;/param-name&gt;
      &lt;param-value&gt;5&lt;/param-value&gt;
  &lt;/context-param&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>javaproj-app-context.xml</strong></p>
  
  <pre><code>&lt;beans:beans xmlns="http://www.springframework.org/schema/security"
               xmlns:beans="http://www.springframework.org/schema/beans"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.springframework.org/schema/beans
                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
                      http://www.springframework.org/schema/security 
                      http://www.springframework.org/schema/security/spring-security-3.1.xsd"&gt;
  
      &lt;http pattern="/Login.jsp*" security="none"/&gt;
      &lt;http pattern="/manage**" security="none"/&gt;
  
      &lt;http  auto-config="true" use-expressions="true"&gt;
          &lt;intercept-url pattern="/**" access="permitAll"/&gt;
          &lt;intercept-url pattern="/j_spring_security_check" access="IS_AUTHENTICATED_ANONYMOUSLY"/&gt;
          &lt;intercept-url pattern="/Login.jsp" access="IS_AUTHENTICATED_ANONYMOUSLY"/&gt;
          &lt;form-login login-page='/Login.jsp' default-target-url='/hello'
                      always-use-default-target='true'/&gt;
          &lt;remember-me/&gt;
          &lt;logout delete-cookies="true" logout-url="/manage"/&gt;
      &lt;/http&gt;
  
      &lt;authentication-manager&gt;
          &lt;authentication-provider&gt;
              &lt;user-service&gt;
                  &lt;user name="prince" password="prince" authorities="ROLE_USER"/&gt;
              &lt;/user-service&gt;
          &lt;/authentication-provider&gt;
      &lt;/authentication-manager&gt;
  &lt;/beans:beans&gt; 
  
  **javaproj-servlet.xml**  
  
  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
         xmlns:s="http://www.springframework.org/schema/security"
  
         xsi:schemaLocation="http://www.springframework.org/schema/beans
         http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd"&gt;
  
  
      &lt;mvc:resources location="/css/" mapping="/css/**"/&gt;
      &lt;mvc:resources location="/image/" mapping="/image/**"/&gt;
      &lt;mvc:resources location="/js/" mapping="/js/**"/&gt;
  
      &lt;mvc:annotation-driven/&gt;
  
      &lt;bean name="/hello" class="com.swiftant.jsp.HelloController"/&gt;
      &lt;bean name="/manage" class="com.swiftant.jsp.ManageController"/&gt;
  
      &lt;bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="prefix" value="/WEB-INF/views/"/&gt;
          &lt;property name="suffix" value=".jsp"/&gt;
      &lt;/bean&gt;
  &lt;/beans&gt; 
  </code></pre>