手抄报 安全手抄报 手抄报内容 手抄报图片 英语手抄报 清明节手抄报 节约用水手抄报

net.sf.ehcache.CacheException异常解决的方法

时间:2024-10-11 19:16:59

1、出现net.sf.ehcache.CacheException: Error configuring from file:/D:/EclipseWorkspace2/hibernate_06_cache/bin/ehcache.xml错误的原因是ehcache.xml文件配置错误

net.sf.ehcache.CacheException异常解决的方法

2、由于上边的ehcache.xml文件不是最原始的文件,经过了多次的修改,在本次项目运行一些配置并不需要,所以解决办法是删除异常提示的错误的配置。Element <defaultCache> does not allow attribute "maxElementsOnDisk".意思是<defaultCache> 下不允许设置maxElementOnDisk属性。删除即可。

net.sf.ehcache.CacheException异常解决的方法

3、最方便的建议网上下载一个ehcache.xml原始文件。这样的话需要的时候在设置。原始的defaultCache配就女蒿鸳置为: <defaultCache maxElementsInMemory="10000" eternal="false" timeToIdleSeconds="120" timeToLiveSeconds="120" overflowToDisk="true" />

net.sf.ehcache.CacheException异常解决的方法

4、将ehcache.xml复制到工程的src目录下,运行程序即可解决异常。

net.sf.ehcache.CacheException异常解决的方法
© 手抄报圈