`
jiangzhong
  • 浏览: 15425 次
  • 性别: Icon_minigender_1
  • 来自: 长沙
文章分类
社区版块
存档分类
最新评论

No configuration found. Configuring ehcache from ehcache-failsafe.xml found in t

阅读更多

错误:No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath 解决

如果在/sandh/web-inf/classes下面没有ehcache.xml这个文件,会报这个错误,No configuration found.


        Configuring ehcache from ehcache-failsafe.xml found in the classpath:.....这个文件是hibernate缓存配置文件。

  1. <ehcache>  
  2. <diskStore path="java.io.tmpdir"/>  
  3. <defaultCache  
  4.     maxElementsInMemory="10000"  
  5.     eternal="false"  
  6.     timeToIdleSeconds="10000"   
  7.     timeToLiveSeconds="10000"   
  8.     overflowToDisk="true"   
  9. />   
  10.   <cache  name="com.hour41.hibernate.vo.common.City"  
  11.     maxElementsInMemory="10000"  
  12.     eternal="false"  
  13.     timeToIdleSeconds="10000"   
  14.     timeToLiveSeconds="10000"   
  15.     overflowToDisk="true"   
  16. />  
  17. </ehcache>  

 


        上面配置了默认类缓存和城市类缓存策略:
        <diskStore>表示当内存缓存中对象数量超过类设置内存缓存数量时,将缓存对象写到硬盘,path=”java.io.tmpdir ”表示把数据写到这个目录下。Java.io.tmpdir目录在运行时会根据相对路径生成。
       <defaultCache>表示设定缓存的默认数据过期策略。
       <cache>表示设定用具体的命名缓存的数据过期策略。
         name表示具体的缓存命名。
         maxElementsInMemory表示cache中最大允许保存的对象数据量。
        eternal表示cache中数据是否为常量。
         timeToIdleSeconds表示缓存数据钝化时间
         timeToLiveSeconds表示缓存数据的生命时间。
        overflowToDisk表示内存不足时,是否启用磁盘缓存。

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics