title: problems configuring Spring + JPA/Hibernate: java.lang.ClassNotFoundException: org.Hibernate.ejb.HibernatePersistence
body: <p>I want to use Spring 3.2.8 + JPA/Hibernate on Oracle DB (first time for me).</p>
  
  <p>I think I can not configure correctly something (persistence unit, spring config files) so i have always an error when deploying in Tomcat.</p>
  
  <pre><code>   Caused by: java.lang.ClassNotFoundException: org.Hibernate.ejb.HibernatePersistence
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
      at org.springframework.util.ClassUtils.forName(ClassUtils.java:255)
      at org.springframework.util.ClassUtils.resolveClassName(ClassUtils.java:288)
      ... 38 more
  
  Aug 08, 2014 1:37:16 AM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Error listenerStart
  Aug 08, 2014 1:37:16 AM org.apache.catalina.core.StandardContext startInternal
  SEVERE: Context [/ftc-wo-webapp] startup failed due to previous errors
  Aug 08, 2014 1:37:16 AM org.apache.catalina.core.ApplicationContext log
  INFO: Closing Spring root WebApplicationContext
  Aug 08, 2014 1:37:16 AM org.apache.coyote.AbstractProtocol start
  INFO: Starting ProtocolHandler ["http-bio-8080"]
  </code></pre>
  
  <p>The hibernate jars (including entity manager jar) are contained in the final war (under WEB-INF/lib) So I don't understand why still the class is not founded.
  The following configuration is present:</p>
  
  <p>persistence.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="1.0"
        xmlns="http://java.sun.com/xml/ns/persistence"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
        http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;
    &lt;persistence-unit name="woBPFlowInfo"&gt;
      &lt;provider&gt;org.Hibernate.ejb.HibernatePersistence&lt;/provider&gt;
      &lt;properties&gt;
        &lt;property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect"/&gt;
        &lt;property name="hibernate.max_fetch_depth" value="3"/&gt;
        &lt;property name="hibernate.hbm2ddl.auto" value="update" /&gt;
        &lt;property name="hibernate.show_sql" value="true" /&gt;
      &lt;/properties&gt;
    &lt;/persistence-unit&gt;
  &lt;/persistence&gt;
  </code></pre>
  
  <p>main spring config file: app_config.xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;beans xmlns="http://www.springframework.org/schema/beans" 
        ...    
      &lt;context:component-scan base-package="com.ftc.webapp" /&gt;
  
      &lt;mvc:annotation-driven/&gt;
  
  &lt;!-- Database added --&gt;
  
      &lt;!-- Loads BPFlowInfo from the JPA system --&gt;
      &lt;bean id="woBPFlowRepository" class="com.ftc.webapp.data.JpaWoBPFlowRepository"/&gt;
  
      &lt;!-- Instructs the container to look for beans with @Transactional and decorate them --&gt;
      &lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;
  
      &lt;!-- Enables annotation-config, needed for @PersistenceContext annotations --&gt;
      &lt;context:annotation-config /&gt;
  
       &lt;import resource="db_config.xml"/&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>db_config.xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!-- // NAME: rewards-db-config.xml // // MODULE: rewardsdb // // PURPOSE: 
      Database and transaction configuration for testing the rewards // application. --&gt;
  &lt;beans xmlns="..."&gt;
  
      &lt;context:annotation-config /&gt;
  
  
      &lt;context:property-placeholder location="classpath:jdbc.properties"/&gt;
  
      &lt;bean id="dataSource"
            class="org.apache.commons.dbcp.BasicDataSource"
            destroy-method="close"&gt;
          &lt;property name="url" value="${jdbc.url}" /&gt;
          &lt;property name="username" value="${jdbc.username}" /&gt;
          &lt;property name="password" value="${jdbc.password}" /&gt;
          &lt;property name="driverClassName" value="${jdbc.driverClassName}" /&gt;
          &lt;property name="testOnBorrow" value="true" /&gt;
          &lt;property name="initialSize" value="2" /&gt;
          &lt;property name="maxActive" value="50" /&gt;
          &lt;property name="removeAbandoned" value="true"/&gt;
          &lt;property name="removeAbandonedTimeout" value="300"/&gt;
          &lt;property name="validationQuery" value="select 1 from dual" /&gt;
      &lt;/bean&gt;
  
      &lt;!-- Translates ORM exceptions to Spring Data Access Exceptions --&gt;
      &lt;bean
          class="org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor" /&gt;
  
      &lt;!-- Data access using 100% JPA --&gt;
          &lt;!-- A transaction manager for working with JPA Entity Managers --&gt;
          &lt;bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"&gt;
              &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;
          &lt;/bean&gt;
  
          &lt;!-- FactoryBean that creates the EntityManagerFactory --&gt;
          &lt;bean id="entityManagerFactory"  class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
              &lt;property name="dataSource" ref="dataSource"/&gt;
              &lt;property name="persistenceUnitName" value="woBPFlowInfo" /&gt;
          &lt;/bean&gt;
  &lt;/beans&gt;
  </code></pre>
  
  <p>and pom.xml contains  following dependencies:</p>
  
  <p>pom.xml</p>
  
  <pre><code>  &lt;properties&gt;
        &lt;smp.version&gt;5.2.2.6&lt;/smp.version&gt;
        &lt;spring.version&gt;3.2.8.RELEASE&lt;/spring.version&gt;
        &lt;hibernate.version&gt;3.4.0.GA&lt;/hibernate.version&gt;
        &lt;javaxServlet.version&gt;2.5&lt;/javaxServlet.version&gt;
        &lt;jackson.version&gt;1.9.5&lt;/jackson.version&gt;      
    &lt;/properties&gt;
    &lt;dependencies&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;javax.annotation&lt;/groupId&gt;
          &lt;artifactId&gt;jsr250-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;${javaxServlet.version}&lt;/version&gt;
          &lt;scope&gt;provided&lt;/scope&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.codehaus.jackson&lt;/groupId&gt;
          &lt;artifactId&gt;jackson-mapper-asl&lt;/artifactId&gt;
          &lt;version&gt;${jackson.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
  
  
      &lt;!-- Persistency &amp; Object Relational mapping --&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.data&lt;/groupId&gt;
          &lt;artifactId&gt;spring-data-jpa&lt;/artifactId&gt;
          &lt;version&gt;1.5.0.RELEASE&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.hibernate&lt;/groupId&gt;
          &lt;artifactId&gt;hibernate-entitymanager&lt;/artifactId&gt;
          &lt;version&gt;${hibernate.version}&lt;/version&gt;
              &lt;exclusions&gt;
                  &lt;exclusion&gt;
                      &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
                      &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
                  &lt;/exclusion&gt;
              &lt;/exclusions&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;commons-dbcp&lt;/groupId&gt;
          &lt;artifactId&gt;commons-dbcp&lt;/artifactId&gt;
          &lt;version&gt;1.4&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;ojdbc&lt;/groupId&gt;
          &lt;artifactId&gt;ojdbc&lt;/artifactId&gt;
          &lt;version&gt;14&lt;/version&gt;
      &lt;/dependency&gt;
  
     &lt;dependency&gt;
          &lt;groupId&gt;log4j&lt;/groupId&gt;
          &lt;artifactId&gt;log4j&lt;/artifactId&gt;
          &lt;version&gt;${log4j.version}&lt;/version&gt;
      &lt;/dependency&gt;
    &lt;/dependencies&gt;
  </code></pre>