title: Hibernate 2nd level cache configuration not working with spring xml, as there is no hibernate specific xml in the application
body: <blockquote>
    <p>Caused by: org.hibernate.cache.NoCacheRegionFactoryAvailableException: Second-level cache is used in the application, but property hibernate.cache.region.factory_class is not given, please either disable second level cache or set correct region factory class name to property hibernate.cache.region.factory_class (and make sure the second level cache provider, hibernate-infinispan, for example, is available in the classpath).</p>
  </blockquote>
  
  <pre><code>&lt;bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"&gt;  
           &lt;property name="dataSource" ref="dataSource"&gt;&lt;/property&gt;  
           &lt;property name="packagesToScan" value="com.genpact.cards.services.database"/&gt;
           &lt;property name="hibernateProperties"&gt;  
               &lt;props&gt;  
                    &lt;prop key="hibernate.dialect"&gt;${hibernate.dialect}&lt;/prop&gt;  
                    &lt;prop key="hibernate.show_sql"&gt;${hibernate.show_sql}&lt;/prop&gt;  
                    &lt;prop key="hibernate.format_sql"&gt;${hibernate.format_sql}&lt;/prop&gt;  
                    &lt;prop key="hibernate.hbm2ddl.auto"&gt;${hibernate.hbm2ddl.auto}&lt;/prop&gt;
                    &lt;prop key="connection.pool_size"&gt;1&lt;/prop&gt;
                    &lt;prop key="maxActive"&gt;1&lt;/prop&gt;
                    &lt;prop key="hibernate.cache.use_query_cache"&gt;false&lt;/prop&gt;
                    &lt;prop key="hibernate.cache.region.factory_class"&gt;org.hibernate.cache.ehcache.EhCacheRegionFactory&lt;/prop&gt;
                    &lt;prop key="hibernate.cache.provider_class"&gt;org.hibernate.cache.EhCacheProvider&lt;/prop&gt;
                    &lt;prop key="hibernate.cache.use_second_level_cache"&gt;${hibernate.cache.use_second_level_cache}&lt;/prop&gt;  
  
  
                    &lt;prop key="hibernate.cache.provider_configuration_file_resource_path"&gt;/ehcache.xml&lt;/prop&gt;
                &lt;/props&gt;  
            &lt;/property&gt;  
      &lt;/bean&gt;  
  </code></pre>