title: java.lang.NoClassDefFoundError: org/apache/commons/pool2/PooledObjectFactory
body: <p>I am new to Spring. I'm using BasicDataSource</p>
  
  <pre><code>&lt;bean id="myDataSource" class="org.apache.commons.dbcp2.BasicDataSource"&gt;
          &lt;property name="driverClassName" value="com.mysql.jdbc.Driver"/&gt;
          &lt;property name="url" value="jdbc:mysql://localhost:3306/MySQL"/&gt;
          &lt;property name="username" value="root"/&gt;
          &lt;property name="password" value="Root"/&gt;
       &lt;/bean&gt;
  
    &lt;bean id="mySessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="myDataSource"/&gt;
      &lt;property name="mappingResources"&gt;
        &lt;list&gt;
          &lt;value&gt;com/test/jdbcTemplate/employee.hbm.xml&lt;/value&gt;
        &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="hibernateProperties"&gt;
        &lt;props&gt;
          &lt;prop key="hibernate.dialect"&gt; org.hibernate.dialect.MySQLDialect&lt;/prop&gt;
          &lt;prop key="hibernate.current_session_context_class"&gt;thread&lt;/prop&gt;
          &lt;prop key="hibernate.transaction.factory_class"&gt;org.hibernate.transaction.JDBCTransactionFactory&lt;/prop&gt;
          &lt;prop key="hibernate.show_sql"&gt;yes&lt;/prop&gt;
        &lt;/props&gt;
      &lt;/property&gt;
    &lt;/bean&gt;
  </code></pre>
  
  <p>I have used hibernate-commons-annotations-3.0.0.ga.jar,commons-pool2-2.0.jar,commons-dbcp2-2.1.jar,mysql-connector-java-5.1.4.jar,hibernate-core-3.6.9.Final.jar.</p>
  
  <p>I am getting this error:</p>
  
  <pre><code>Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'employeeHibernateTemplateImpl' defined in class path resource [com/test/jdbcTemplate/EmployeeBean.xml]: Cannot resolve reference to bean 'hibernateTemplate' while setting bean property 'hibernateTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [com/test/jdbcTemplate/EmployeeBean.xml]: Cannot resolve reference to bean 'mySessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mySessionFactory' defined in class path resource [com/test/jdbcTemplate/EmployeeBean.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/annotations/common/reflection/MetadataProvider
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:328)
      at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:106)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1360)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1118)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:517)
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456)
      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294)
      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225)
      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291)
      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193)
      at com.test.jdbcTemplate.EmployeeHibernateTemplateImplAssembler.main(EmployeeHibernateTemplateImplAssembler.java:17)
  </code></pre>