title: Spring Data JPA with Hibernate mapping files
body: <p>I want to use Spring Data JPA with Hibernate mapping files and without JPA-Annotations.</p>
  
  <p>But I'am facing this exception on server startup (tomcat):</p>
  
  <pre><code>java.lang.IllegalStateException: No persistence units parsed from {classpath*:META-INF/persistence.xml}
  at org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager.obtainDefaultPersistenceUnitInfo(DefaultPersistenceUnitManager.java:547)
  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.determinePersistenceUnitInfo(LocalContainerEntityManagerFactoryBean.java:311)
  at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:260)
  
  My dispatch-servlet.xml looks like the following:
  &lt;bean id="entityManagerFactory"
      class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;
      &lt;!--&lt;property name="persistenceUnitName" value="BLUPP" /&gt;--&gt;
      &lt;property name="dataSource" ref="dataSource" /&gt;
      &lt;property name="jpaVendorAdapter" ref="hibernateJpaVendorAdapter" /&gt;
      &lt;!-- &lt;property name="packagesToScan" value="org.cleanyourway.server.beans" /&gt;--&gt;
      &lt;property name="persistenceUnitPostProcessors"&gt;
          &lt;list&gt;
              &lt;bean
                  class="org.springframework.data.jpa.support.ClasspathScanningPersistenceUnitPostProcessor"&gt;
                  &lt;constructor-arg value="org.xxxxxx.server.beans" /&gt;
                  &lt;property name="mappingFileNamePattern" value="**hbm.xml" /&gt;
              &lt;/bean&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>Is it possible to use Hibernate mapping files with the ClasspathScanningPersistenceUnitPostProcessor? </p>
  
  <p>I get it running with </p>
  
  <pre><code>&lt;property name="packagesToScan" value="org.xxxxxxx.server.beans" /&gt;
  </code></pre>
  
  <p>and JPA Annotations.</p>
  
  <p>Thanks for your help!</p>