java.lang.NoClassDefFoundError:org / hibernate / cache / TimestampsRegion

时间:2015-04-01 09:15:16

标签: java spring hibernate maven caching

我正在尝试在我的应用程序中实现hibernate二级缓存。

的pom.xml

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-ehcache</artifactId>
    <version>4.3.8.Final</version>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.1.5.Final</version>
</dependency>

的persistence.xml

<property name="hibernate.cache.region.factory_class" value="net.sf.ehcache.hibernate.EhCacheRegionFactory"/>
<property name="hibernate.cache.provider_class" value="org.hibernate.cache.SingletonEhCacheProvider"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.cache.use_query_cache" value="true"/>

1 个答案:

答案 0 :(得分:1)

来自hibernate 4,在persistance.xml中

<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.EhCacheRegionFactory"/>