ehcache could not remove disk store for sql2010-4-13 9:42:13 org.apache.catalina.core.StandardWrapperValve invoke严重: Servlet.service() for servlet jsp threw exceptionnet.sf.ehcache.CacheException: tenMinuteCacheCache: Could not remove disk store entry for class com.chinaclick.terry.util.ContentUtils_20. Error was tenMinuteCache Cache: The Disk store is not active.at net.sf.ehcache.store.DiskStore.remove(DiskStore.java:469)at net.sf.ehcache.Cache.remove(Cache.java:1101)at net.sf.ehcache.Cache.searchInMemoryStore(Cache.java:908)at net.sf.ehcache.Cache.get(Cache.java:733)at net.sf.ehcache.Cache.get(Cache.java:710)at com.chinaclick.allen.front.util.ShowUtil.getObject(ShowUtil.java:223)at com.chinaclick.terry.util.ContentUtils.getNews(ContentUtils.java:204)at org.apache.jsp.front.index_jsp._jspService(index_jsp.java:142)at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)at java.lang.reflect.Method.invoke(Method.java:597)
是缓存路径问题
首先说明:我们在ehcache.xml <diskStore path="java.io.tmpdir"/>配置了缓存溢出到的磁盘路径
可以通过:
- System.out.println(System.getProperty("java.io.tmpdir"));
- 在文件按目录下有一下文件:
- com.eric.po.B.data--------0kb
- cache_a.data ------------4 kb
- org.hibernate.cache.StandardQueryCache.data ---0kb
- org.hibernate.cache.UpdateTimestampsCache.data -----0kb
在文件按目录下有一下文件:com.eric.po.B.data--------0kbcache_a.data ------------4 kborg.hibernate.cache.StandardQueryCache.data ---0kborg.hibernate.cache.UpdateTimestampsCache.data -----0kb
其中 cache_a中保存了我们的缓存文件
StandardQueryCache.data 则是 设置默认的查询缓存的数据过期策略 产生的文件,
org.hibernate.cache.UpdateTimestampsCache.data则是 设置时间戳缓存的数据过期策略
如果不适用我们自己的缓存配置就会使用类类的全路径路径文件(com.eric.po.B.data)来缓存我们的数据。