title: Spring application deployed but context fails to start
body: <p>After some modifications in my XML configuration files, my current spring project do not start anymore on tomcat. Message displayed is:</p>
  
  <pre><code>FAIL - Deployed application at context path /loja but context failed to start
  </code></pre>
  
  <p>in the <strong>catalina.out</strong> file, it's displayed this error message:</p>
  
  <pre><code>GRAVE: One or more listeners failed to start. Full details will be found in the appropriate container log file
  fev 10, 2017 8:56:35 AM org.apache.catalina.core.StandardContext startInternal
  GRAVE: Context [/loja] startup failed due to previous errors
  fev 10, 2017 8:56:35 AM org.apache.catalina.startup.HostConfig deployWAR
  INFORMAÇÕES: Deployment of web application archive /var/lib/tomcat8/webapps/loja.war has finished in 1,045 ms
  </code></pre>
  
  <p>my configurations files are:</p>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
      &lt;display-name&gt;loja&lt;/display-name&gt;
  
      &lt;context-param&gt;
          &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
          &lt;param-value&gt;/WEB-INF/rootContext.xml,/WEB-INF/securityContext.xml&lt;/param-value&gt;
      &lt;/context-param&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;org.springframework.web.context.request.RequestContextListener&lt;/listener-class&gt;
      &lt;/listener&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;springmvcapp&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
              &lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;
          &lt;/init-param&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;springmvcapp&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;filter-class&gt;org.springframework.web.filter.DelegatingFilterProxy&lt;/filter-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;org.springframework.web.context.WebApplicationContext.ROOT&lt;/param-name&gt;
              &lt;param-value&gt;param-value&lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/filter&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;springSecurityFilterChain&lt;/filter-name&gt;
          &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>rootContext.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:p="http://www.springframework.org/schema/p"
          xmlns:context="http://www.springframework.org/schema/context"
          xmlns:security="http://www.springframework.org/schema/security"
          xmlns:mvc="http://www.springframework.org/schema/mvc"
          xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;  
  
      &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
          &lt;property name="driverClassName" value="org.postgresql.Driver"/&gt;
          &lt;property name="url" value="jdbc:postgresql:mydata"/&gt;
          &lt;property name="username" value="kleber"/&gt;
          &lt;property name="password" value="123"/&gt;
      &lt;/bean&gt;
  
      &lt;bean id="hibernate4AnnotatedSessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource"/&gt;
          &lt;property name="packagesToScan" value="org.kleber.model" /&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.PostgreSQLDialect&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;false&lt;/prop&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;create-drop&lt;/prop&gt;
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>applicationContext.xml</strong></p>
  
  <pre><code>&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:p="http://www.springframework.org/schema/p"
      xmlns:context="http://www.springframework.org/schema/context"
      xmlns:security="http://www.springframework.org/schema/security"
      xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;
      &lt;context:component-scan base-package="org.kleber"&gt;&lt;/context:component-scan&gt;
  
      &lt;context:annotation-config/&gt;
  
      &lt;security:global-method-security secured-annotations="enabled" jsr250-annotations="disabled" pre-post-annotations="enabled"/&gt;
  
      &lt;bean id="templateResolver"
          class="org.thymeleaf.templateresolver.ServletContextTemplateResolver"&gt;
          &lt;property name="prefix"&gt;
              &lt;value&gt;/WEB-INF/views/&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="suffix"&gt;
              &lt;value&gt;.html&lt;/value&gt;
          &lt;/property&gt;
          &lt;property name="templateMode"&gt;
              &lt;value&gt;HTML5&lt;/value&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="templateEngine"
          class="org.thymeleaf.spring4.SpringTemplateEngine"&gt;
          &lt;property name="templateResolver" ref="templateResolver"&gt;&lt;/property&gt;
          &lt;property name="additionalDialects"&gt;
              &lt;set&gt;
                  &lt;bean class="org.kleber.thymeleaf.dialect.Field"/&gt;
                  &lt;bean class="org.kleber.thymeleaf.dialect.Form"/&gt;
                  &lt;bean class="org.kleber.thymeleaf.dialect.Util"/&gt;
                  &lt;bean class="org.thymeleaf.extras.springsecurity4.dialect.SpringSecurityDialect"/&gt;
              &lt;/set&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean class="org.thymeleaf.spring4.view.ThymeleafViewResolver"&gt;
          &lt;property name="templateEngine" ref="templateEngine"&gt;&lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="messageSource"
          class="org.springframework.context.support.ResourceBundleMessageSource"&gt;
          &lt;property name="basename" value="messages"&gt;&lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;mvc:annotation-driven/&gt;
  
      &lt;mvc:resources location="/css/" mapping="/css/**" /&gt;
      &lt;mvc:resources location="/img/" mapping="/img/**" /&gt;
      &lt;mvc:resources location="/js/" mapping="/js/**" /&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p><strong>securityContext.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://java.sun.com/xml/ns/javaee"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:p="http://www.springframework.org/schema/p"
          xmlns:context="http://www.springframework.org/schema/context"
          xmlns:security="http://www.springframework.org/schema/security"
          xmlns:mvc="http://www.springframework.org/schema/mvc"
          xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd"&gt;  
      &lt;security:http pattern="/" security="none"&gt;&lt;/security:http&gt;
  
      &lt;security:http pattern="/css/**" security="none"&gt;&lt;/security:http&gt;
  
      &lt;security:http pattern="/img/**" security="none"&gt;&lt;/security:http&gt;
  
      &lt;security:http pattern="/js/**" security="none"&gt;&lt;/security:http&gt;
  
      &lt;security:http&gt;
          &lt;security:form-login login-page="/signin" login-processing-url="/login" /&gt;
          &lt;security:logout logout-url="/logout" delete-cookies='JSESSIONID' /&gt;
          &lt;security:remember-me key="remember-me" /&gt;
          &lt;security:intercept-url pattern="/admin" access="hasRole('admin')" /&gt;
      &lt;/security:http&gt;
  
      &lt;security:authentication-manager&gt;
          &lt;security:authentication-provider user-service-ref="userDetailsService"&gt;
              &lt;security:password-encoder ref="passwordEncoder"&gt;&lt;/security:password-encoder&gt;
          &lt;/security:authentication-provider&gt;
      &lt;/security:authentication-manager&gt;
  
      &lt;bean id="userDetailsService" class="org.springframework.security.core.userdetails.jdbc.JdbcDaoImpl"&gt;
          &lt;property name="dataSource" ref="dataSource"&gt;&lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="passwordEncoder" class="org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder"&gt;&lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>Anyone can see what's wrong here?</p>