zzhlulu 2010-01-06 21:41
浏览 391
已采纳

Ehcache缓存警告问题?

请教各位,我在spring+hibernate里配置Ehcache缓存,出现以下警告,请问是什么原因呢?

警告: Creating a new instance of CacheManager using the diskStorePath "D:\Apache Tomcat 6.0.18\temp" which is already used by an existing CacheManager.
The source of the configuration was classpath.
The diskStore path for this CacheManager will be set to D:\Apache Tomcat 6.0.18\temp\ehcache_auto_created_1262783591937.
To avoid this warning consider using the CacheManager factory methods to create a singleton CacheManager or specifying a separate ehcache configuration (ehcache.xml) for each CacheManager instance.

applicationContext.xml里

true
true
org.hibernate.cache.EhCacheProvider

ehcache.xml里



timeToIdleSeconds="60" timeToLiveSeconds="60" overflowToDisk="true"
diskSpoolBufferSizeMB="30" maxElementsOnDisk="1000000"
diskPersistent="false" diskExpiryThreadIntervalSeconds="60"
memoryStoreEvictionPolicy="LRU" />

  • 写回答

1条回答 默认 最新

  • yjailj 2010-01-07 10:41
    关注

    说下自己的经历吧 : 我之前是只写了自己的 缓存.没有写 默认的
    [code="xml"]<?xml version="1.0" encoding="UTF-8"?>

    <diskStore path="java.io.tmpdir" />
    
    <cache name="sampleCache1" maxElementsInMemory="10000" eternal="false" 
        timeToIdleSeconds="300" timeToLiveSeconds="600" overflowToDisk="true" />
    

    [/code]

    启动的时候报没有默认缓存配置的 WARN , 后来加上就好了[code="xml"] maxElementsInMemory="10000"
    eternal="false"
    timeToIdleSeconds="120"
    timeToLiveSeconds="120"
    overflowToDisk="true"
    diskPersistent="false"
    diskExpiryThreadIntervalSeconds="120"
    memoryStoreEvictionPolicy="LRU" />
    [/code]

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器