title: org.hibernate.UnknownEntityTypeException: Unable to locate persister: entity.Settings
body: <p>I am trying to use Hibernate 5 (5.2.11) together with Spring ORM.</p>
  
  <p>Following tutorials I came up with following configuration:</p>
  
  <p><strong>Spring Bean</strong></p>
  
  <pre><code>&lt;bean id="sessionFactorySettings" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"&gt;
      &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.H2Dialect&lt;/prop&gt;
              &lt;prop key="hibernate.connection.driver_class"&gt;org.h2.Driver&lt;/prop&gt;
              &lt;prop key="hibernate.connection.url"&gt;jdbc:h2:~/.dummy/settings&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="mappingResources"&gt;
          &lt;list&gt;
              &lt;value&gt;/hibernate.cfg.xml&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p><strong>Hibernate</strong> (hibernate.cfg.xml)</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='utf-8'?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD//EN"
          "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"&gt;
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;mapping class="entity.Settings"/&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>
  
  <p>This configuration leads to a <code>org.hibernate.UnknownEntityTypeException: Unable to locate persister: entity.Settings</code>.</p>
  
  <p>However, as soon as I move all </p>
  
  <pre><code>&lt;prop key="hibernate.xxx"&gt;..&lt;/prob&gt;
  </code></pre>
  
  <p>properties into <em>hibernate.cfg.xml</em> and I change the Spring configuration to</p>
  
  <pre><code>&lt;bean id="sessionFactorySettings" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean"&gt;
          &lt;property name="configLocation" value="/hibernate.cfg.xml"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>everything works fine.</p>
  
  <p>Any idea what I do wrong?</p>
  
  <p>PS: Dependencies:</p>
  
  <pre><code>dependencies {
      compile 'ch.qos.logback:logback-classic:1.2.3'
      compile 'org.springframework:spring-context:4.3.11.RELEASE'
      compile 'org.springframework:spring-jdbc:4.3.11.RELEASE'
      compile 'org.springframework:spring-orm:4.3.11.RELEASE'
      compile 'org.hibernate:hibernate-core:5.2.11.Final'
      compile 'org.hibernate:hibernate-java8:5.2.11.Final'
      compile 'org.apache.commons:commons-dbcp2:2.1.1'
      compile 'com.h2database:h2:1.4.196'
  }
  </code></pre>