Hi Folks,
I need some help. I inherited a Spring 2/Hibernate 3 application, which needed to be migrated forward. I can compile the application, but runtime returns:
Code:
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1479)
... 13 more
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 using the hibernate.cache.region.factory_class setting and make sure the second level cache provider (hibernate-infinispan, e.g.) is available on the classpath.
at org.hibernate.cache.internal.NoCachingRegionFactory.buildTimestampsRegion(NoCachingRegionFactory.java:105)
at org.hibernate.cache.spi.UpdateTimestampsCache.<init>(UpdateTimestampsCache.java:73)
I've tried everything I can think of. In the applicationContext of that class (ignore line wraps):
Code:
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernatespatial.postgis.PostgisDialect</prop>
<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop>
<prop key="hibernate.cache.provider_configuration">ehcache.cfg.xml</prop>
<prop key="hibernate.cache.use_minimal_puts">true</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.cache.use_second_level_cache">true</prop>
<prop key="hibernate.cache.use_structured_entries">true</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.format_sql">true</prop>
<prop key="hibernate.use_sql_comments">false</prop>
<prop key="hibernate.connection.autocommit">true</prop>
</props>
</property>
It does not matter if I change hibernate.cache.use_second_level_cache to false, it still dumps the same error.
In my target, I have both the hibernate-core-4.3.1.Final.jar and the hibernate-ehcache-4.3.1.Final.jar
Any clue would be much appreciated...
Thanks,
Matt