title: java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
body: <p>i am using <strong>spring 3.1.0.RELEASE</strong>, and my servlet container is <strong>tomcat 7</strong> and my IDE is <strong>eclipse indigo</strong>
  and the jar <strong>spring-webmvc-3.1.0.RELEASE.jar</strong> which contains the <strong>DispatcherServlet</strong>
  exists in the lib folder, and yet when running the application, i am getting the exception:</p>
  
  <pre><code>java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
      at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:525)
      at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:507)
      at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:126)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1043)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)
      at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5284)
      at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5279)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:662)
  </code></pre>
  
  <p>please advise why i am getting this exception, and how to fix it.</p>
  
  <p>EDIT: following are my configuration files:</p>
  
  <p><strong>1- .springBeans:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beansProjectDescription&gt;
      &lt;version&gt;1&lt;/version&gt;
      &lt;pluginVersion&gt;&lt;![CDATA[2.9.0.201203011806-RELEASE]]&gt;&lt;/pluginVersion&gt;
      &lt;configSuffixes&gt;
          &lt;configSuffix&gt;&lt;![CDATA[xml]]&gt;&lt;/configSuffix&gt;
      &lt;/configSuffixes&gt;
      &lt;enableImports&gt;&lt;![CDATA[false]]&gt;&lt;/enableImports&gt;
      &lt;configs&gt;
          &lt;config&gt;src/main/webapp/WEB-INF/checkout-servlet.xml&lt;/config&gt;
      &lt;/configs&gt;
      &lt;configSets&gt;
      &lt;/configSets&gt;
  &lt;/beansProjectDescription&gt;
  </code></pre>
  
  <p><strong>2- web.xml:</strong></p>
  
  <p></p>
  
  <pre><code>&lt;web-app&gt;
    &lt;display-name&gt;Checkout&lt;/display-name&gt;
  
    &lt;servlet&gt;
      &lt;servlet-name&gt;checkout&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;checkout&lt;/servlet-name&gt;
      &lt;url-pattern&gt;*.action&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  
  &lt;/web-app&gt;
  </code></pre>
  
  <p><strong>3- checkout-servlet.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:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
          http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"&gt;
  
      &lt;context:component-scan base-package="com.myapp"/&gt;
  
      &lt;bean id="myService" class="com.myapp.MyService"/&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <p>also when trying to access any page in the application, i get the exception:</p>
  
  <pre><code>HTTP Status 404 - Servlet checkout is not available
  
  type Status report
  
  message Servlet checkout is not available
  
  description The requested resource (Servlet checkout is not available) is not available.
  Apache Tomcat/7.0.22
  </code></pre>