title: java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet (even i have spring-webmvc.jar)
body: <p>I'm trying to create scratch level project with spring mvc and hibernate. in that situation i downloaded all jar related to spring and hibernate.   While running my project i'm getting below error. </p>
  
  <pre><code>java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
  </code></pre>
  
  <p>But as my knowledge <code>DipatcherServlet</code> class will available in <code>spring-webmvc.jar</code>, i added this jar also. 
  Please see the below code and Help me</p>
  
  <p>web.xml</p>
  
  <hr>
  
  <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://java.sun.com/xml/ns/javaee"
          xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
          id="WebApp_ID" version="2.5"&gt;
          &lt;display-name&gt;Spring Hello World&lt;/display-name&gt;
          &lt;welcome-file-list&gt;
              &lt;welcome-file&gt;/&lt;/welcome-file&gt;
          &lt;/welcome-file-list&gt;
  
          &lt;servlet&gt;
              &lt;servlet-name&gt;springDispatcher&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/config/spring-context.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;springDispatcher&lt;/servlet-name&gt;
              &lt;url-pattern&gt;/&lt;/url-pattern&gt;
          &lt;/servlet-mapping&gt;
  
          &lt;context-param&gt;
              &lt;param-name&gt;javax.faces.FACELETS_SKIP_COMMENTS&lt;/param-name&gt;
              &lt;param-value&gt;true&lt;/param-value&gt;
          &lt;/context-param&gt;
      &lt;/web-app&gt;
  </code></pre>
  
  <h2>spring-context.xml</h2>
  
  <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:mvc="http://www.springframework.org/schema/mvc"
      xmlns:context="http://www.springframework.org/schema/context"
      xsi:schemaLocation="
          http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
          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;context:property-placeholder location="classpath:resources/database.properties" /&gt;
      &lt;context:component-scan base-package="user.controller" /&gt;
      &lt;mvc:annotation-driven /&gt;
  
      &lt;bean
          class="org.springframework.web.servlet.view.InternalResourceViewResolver"&gt;
          &lt;property name="prefix" value="/WEB-INF/view/" /&gt;
          &lt;property name="suffix" value=".jsp" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="dataSource"
          class="org.springframework.jdbc.datasource.DriverManagerDataSource"&gt;
          &lt;property name="driverClassName" value="${database.driver}" /&gt;
          &lt;property name="url" value="${database.url}" /&gt;
          &lt;property name="username" value="${database.user}" /&gt;
          &lt;property name="password" value="${database.password}" /&gt;
      &lt;/bean&gt;
  
      &lt;bean id="sessionFactory"
          class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
          &lt;property name="dataSource" ref="dataSource" /&gt;
          &lt;property name="annotatedClasses"&gt;
              &lt;list&gt;
                  &lt;value&gt;user.model.Employee&lt;/value&gt;
              &lt;/list&gt;
          &lt;/property&gt;
          &lt;property name="hibernateProperties"&gt;
              &lt;props&gt;
                  &lt;prop key="hibernate.dialect"&gt;${hibernate.dialect}&lt;/prop&gt;
                  &lt;prop key="hibernate.show_sql"&gt;${hibernate.show_sql}&lt;/prop&gt;
                  &lt;prop key="hibernate.hbm2ddl.auto"&gt;${hibernate.hbm2ddl.auto}&lt;/prop&gt;             
              &lt;/props&gt;
          &lt;/property&gt;
      &lt;/bean&gt;
  
      &lt;bean id="hibernateTransactionManager"
          class="org.springframework.orm.hibernate3.HibernateTransactionManager"&gt;
          &lt;property name="sessionFactory" ref="sessionFactory" /&gt;
      &lt;/bean&gt;
  
  &lt;/beans&gt;
  </code></pre>
  
  <h2>pom.xml</h2>
  
  <pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://maven.apache.org/maven-v4_0_0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      &lt;groupId&gt;com.myproject&lt;/groupId&gt;
      &lt;artifactId&gt;addaroot&lt;/artifactId&gt;
      &lt;packaging&gt;war&lt;/packaging&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;name&gt;addaroot Maven Webapp&lt;/name&gt;
      &lt;url&gt;http://maven.apache.org&lt;/url&gt;
  
      &lt;!-- &lt;build&gt;
          &lt;finalName&gt;${project.artifactId}-${project.version}&lt;/finalName&gt;
          &lt;pluginManagement&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;source&gt;1.7&lt;/source&gt;
                          &lt;target&gt;1.7&lt;/target&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
      &lt;/build&gt; --&gt;
  
      &lt;!-- &lt;properties&gt;
          &lt;org.slf4j.version&gt;1.6.4&lt;/org.slf4j.version&gt;
          &lt;org.springframework.version&gt;3.1.0.RELEASE&lt;/org.springframework.version&gt;
      &lt;/properties&gt; --&gt;
  
      &lt;properties&gt;
          &lt;spring.version&gt;3.1.2.RELEASE&lt;/spring.version&gt;
      &lt;/properties&gt;
  
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;3.8.1&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
              &lt;version&gt;1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.glassfish.web&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet.jsp.jstl&lt;/artifactId&gt;
              &lt;version&gt;1.2.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;commons-logging&lt;/groupId&gt;
              &lt;artifactId&gt;commons-logging&lt;/artifactId&gt;
              &lt;version&gt;1.1.1&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- &lt;dependency&gt;
              &lt;groupId&gt;spring&lt;/groupId&gt;
              &lt;artifactId&gt;spring&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt; --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-core&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-expression&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt; 
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-web&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-webmvc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-asm&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-oxm&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-beans&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-jdbc&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;spring-orm&lt;/artifactId&gt;
              &lt;version&gt;${spring.version}&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;!-- &lt;dependency&gt;
              &lt;groupId&gt;org.springframework&lt;/groupId&gt;
              &lt;artifactId&gt;org.springframework.web.servlet&lt;/artifactId&gt;
              &lt;version&gt;3.0.5.RELEASE&lt;/version&gt;
          &lt;/dependency&gt; --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;mysql&lt;/groupId&gt;
              &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt;
              &lt;version&gt;5.1.6&lt;/version&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Hibernate dependencies. --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate&lt;/artifactId&gt;
              &lt;version&gt;3.1.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-annotations&lt;/artifactId&gt;
              &lt;version&gt;3.4.0.GA&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
              &lt;artifactId&gt;hibernate-core&lt;/artifactId&gt;
              &lt;version&gt;3.6.8.Final&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.7.6&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.persistence&lt;/groupId&gt;
              &lt;artifactId&gt;persistence-api&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;servlet-api&lt;/artifactId&gt;
              &lt;version&gt;2.3&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet.jsp&lt;/groupId&gt;
              &lt;artifactId&gt;jsp-api&lt;/artifactId&gt;
              &lt;version&gt;2.1&lt;/version&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
      &lt;repositories&gt;
          &lt;repository&gt;
            &lt;id&gt;maven2-repository.dev.java.net&lt;/id&gt;
            &lt;name&gt;Java.net Repository for Maven&lt;/name&gt;
            &lt;url&gt;http://download.java.net/maven/2/&lt;/url&gt;
            &lt;layout&gt;default&lt;/layout&gt;
          &lt;/repository&gt;
          &lt;!-- &lt;repository&gt;
              &lt;id&gt;maven-restlet&lt;/id&gt;
              &lt;name&gt;Public online Restlet repository&lt;/name&gt;
              &lt;url&gt;http://maven.restlet.org&lt;/url&gt;
          &lt;/repository&gt; --&gt;
      &lt;/repositories&gt;
      &lt;build&gt;
          &lt;finalName&gt;addaroot&lt;/finalName&gt;
      &lt;/build&gt; 
  &lt;/project&gt;
  </code></pre>
  
  <h2>console</h2>
  
  <pre><code>SEVERE: Servlet /addaroot threw load() exception
  java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1702)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1547)
      at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:532)
      at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:514)
      at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:142)
      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1144)
      at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
      at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
      at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:663)
      at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1642)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
      at java.util.concurrent.FutureTask.run(FutureTask.java:262)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:744)
  
  Feb 21, 2014 10:46:03 AM org.apache.catalina.startup.HostConfig deployDescriptor
  </code></pre>