title: Cannot find class [org.apache.commons.dbcp.BasicDataSource]
body: <p>I am getting this exception when trying to start my spring MVC hibernate app.</p>
  
  <pre><code>SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
  org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring/appServlet/mysql_persistence_info.xml]; nested exception is java.lang.ClassNotFoundException: org.apache.commons.dbcp.BasicDataSource
      at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1235)
  </code></pre>
  
  <p>My /WEB-INF/spring/appServlet/mysql_persistence_info.xml is </p>
  
  <pre><code>  &lt;beans xmlns="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-2.5.xsd"&gt;
  
      &lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"&gt;
      &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
      &lt;property name="url" value="jdbc:mysql://localhost/MyrDB"/&gt;
      &lt;property name="username" value="user"/&gt;
      &lt;property name="password" value="user"/&gt;
      &lt;!-- connection pooling details --&gt;
      &lt;property name="initialSize" value="1"/&gt;
      &lt;property name="maxActive" value="5"/&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="hibernateProperties"&gt;
      &lt;props&gt;
      &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.MySQL5InnoDBDialect&lt;/prop&gt;
      &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
      &lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt;
      &lt;/props&gt;
      &lt;/property&gt;
      &lt;property name="annotatedClasses"&gt;
      &lt;list&gt;
      &lt;!--   all the annotation entity classes --&gt;
      &lt;/list&gt;
      &lt;/property&gt;
      &lt;/bean&gt;
      &lt;/beans&gt;
  </code></pre>
  
  <p>I have all jar files required in classapath.
  I am using STS. </p>
  
  <p>I have commons-dbcp.jar and all the rest of the jar files too.</p>