title: SEVERE: Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException:
body: <p>I am new to Spring MVC. I am getting below error  when I am trying to run my dynamic web project in tomcat 8.5 This is my first project in Spring</p>
  
  <p><strong>Error</strong></p>
  
  <blockquote>
    <p>SEVERE: Exception sending context initialized event to listener
    instance of class
    org.springframework.web.context.ContextLoaderListener
            org.springframework.beans.factory.BeanDefinitionStoreException:
    IOException parsing XML document from ServletContext resource
    [/WEB-INF/applicationContext.xml]; nested exception is
    java.io.FileNotFoundException: Could not open ServletContext resource
    [/WEB-INF/applicationContext.xml]
              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:344)
              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:304)
              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:181)
              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:217)
              at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:188)
              at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
              at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
              at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:129)
              at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:613)
              at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:514)
              at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
              at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
              at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
              at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4727)
              at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5189)
              at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
              at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
              at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
            Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
              at org.springframework.web.context.support.ServletContextResource.getInputStream(ServletContextResource.java:141)
              at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:330)
              ... 21 more</p>
  </blockquote>
  
  <p><strong>my web.xml file:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
      &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1"&gt;
        &lt;display-name&gt;SpringMVCTest&lt;/display-name&gt;
        &lt;welcome-file-list&gt;
  
          &lt;welcome-file&gt;index.jsp&lt;/welcome-file&gt;
  
        &lt;/welcome-file-list&gt;
  
        &lt;servlet&gt;
          &lt;servlet-name&gt;dispatcher&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;dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/&lt;/url-pattern&gt;
        &lt;/servlet-mapping&gt;
  
      &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>my dispatcher-servlet.xml file:</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:context="http://www.springframework.org/schema/context"
          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"&gt;
  
          &lt;bean id="handlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"&gt;
  
          &lt;/bean&gt;
  
          &lt;bean name="/" class="com.learn.spring.controller.BaseController"&gt;&lt;/bean&gt;
  
          &lt;bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
              &lt;property name="prefix"&gt;
                  &lt;value&gt;/&lt;/value&gt;
              &lt;/property&gt;
              &lt;property name="suffix"&gt;
                  &lt;value&gt;.jsp&lt;/value&gt;
              &lt;/property&gt;
          &lt;/bean&gt;
  
      &lt;/beans&gt;
  </code></pre>
  
  <p>I am just trying to print message in a page, do I need applicationContext.xml file? If yes, how can I add it in my project? I read that spring searches [servlet-name]-servlet.xml file. </p>