我无法使用休眠配置ehcache [英] I am not able to configure ehcache with hibernate

查看:102
本文介绍了我无法使用休眠配置ehcache的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

相应的jar文件如下:

corresponding jar files i used are below :


  • ehcache-3.2.0

  • 休眠-ehcache-5.0.2.Final

  • hibernate-core-5.0.2.Final

配置是这样的:

  <prop key="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</prop> 
 <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</prop>
 <prop key="hibernate.cache.use_second_level_cache" >true</prop>
 <prop key="hibernate.cache.use_query_cache">true</prop>
 <prop key="net.sf.ehcache.configurationResourceName">/ehcache.xml</prop>

我遇到这样的错误:


java.lang.NoClassDefFoundError:net / sf / ehcache / CacheException

java.lang.NoClassDefFoundError: net/sf/ehcache/CacheException

帮我弄清楚这个问题

推荐答案

我认为您需要此工件:

<dependency> 
   <groupId>net.sf.ehcache</groupId> 
   <artifactId>ehcache-core</artifactId> 
   <version>2.10.3</version> 
</dependency>

它包含 net.sf.ehcache

基于您的休眠属性:

<prop key="net.sf.ehcache.configurationResourceName">/ehcache.xml</prop>

这篇关于我无法使用休眠配置ehcache的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆