WARNNo configuration found. Configuring ehcache from ehcache-failsafe.xml....

xiaoxiao2022-06-12  39

警告: No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/C:/Program Files/Tomcat 5.5/webapps/XFWebs/WEB-INF/lib/ehcache-1.2.4.jar!/ehcache-failsafe.xml 原因:报这个错是因为在/sandh/web-inf/classes下面没有ehcache.xml这个文件!这个文件是hibernate缓存配置文件。 解决方法:从ehcache-1.1.jar 中把文件ehcache-failsafe.xml 解压出来改名 ehcache.xml 复制到classes下面就行了! 配置文件解读: <diskStore>表示当内存缓存中对象数量超过类设置内存缓存数量时,将缓存对象写到硬盘,path=”java.io.tmpdir ”表示把数据写到这个目录下。Java.io.tmpdir目录在运行时会根据相对路径生成。 <defaultCache>表示设定缓存的默认数据过期策略。 <cache>表示设定用具体的命名缓存的数据过期策略。 name表示具体的缓存命名。 maxElementsInMemory表示cache中最大允许保存的对象数据量。 eternal表示cache中数据是否为常量。 timeToIdleSeconds表示缓存数据钝化时间 timeToLiveSeconds表示缓存数据的生命时间。 overflowToDisk表示内存不足时,是否启用磁盘缓存。 相关资源:Java 面经手册·小傅哥(公众号:bugstack虫洞栈).pdf
转载请注明原文地址: https://www.6miu.com/read-4932248.html

最新回复(0)