惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

月光博客
月光博客
Martin Fowler
Martin Fowler
Last Week in AI
Last Week in AI
罗磊的独立博客
阮一峰的网络日志
阮一峰的网络日志
博客园 - 【当耐特】
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
V
Visual Studio Blog
Hugging Face - Blog
Hugging Face - Blog
雷峰网
雷峰网
博客园_首页
人人都是产品经理
人人都是产品经理
量子位
美团技术团队
The Cloudflare Blog
小众软件
小众软件
WordPress大学
WordPress大学
有赞技术团队
有赞技术团队
M
MIT News - Artificial intelligence
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net
博客园 - Franky

博客园 - 冰绿茶

关于NHibernate、Castle和WCF做分布式事务时发生异常的解决办法 数据绑定控件和XmlDataSource控件结合使用,通过后台绑定Xml数据片段遇到的问题 微软StockTrader 2.03 学习笔记(8)--配置服务实现示例指南(四) 微软StockTrader 2.03 学习笔记(7)--配置服务实现示例指南(三) 微软StockTrader 2.03 学习笔记(6)--配置服务实现示例指南(二) 微软StockTrader 2.03 学习笔记(5)--配置服务实现示例指南(一) 微软StockTrader 2.03 学习笔记(4)--配置数据库生成工具介绍 SQLServer实战经验分享--ServiceBroker安全配置和使用示例 ASP.NET Trick文章系列--使用State Server管理Session状态的另类经济用法 微软StockTrader 2.03 学习笔记(3)--配置网站和配置服务在StockTrader中的使用示例 在数据库事务设计中经常会遇到的疑惑 微软StockTrader 2.03 学习笔记(2)--什么是配置网站和配置服务、配置存储库 微软StockTrader 2.03 学习笔记(1)--学习大纲整理 asp.net 2.0页面性能的考虑--异步页面处理模型 Asp.net 2.0 动态加载其他子目录用户控件问题 Web 下配置文件信息的读写 .net 2.0 中对配置文件的读写 ASP.NET 2.0加密网站配置文件中的信息 - 冰绿茶 - 博客园 Understanding ASP.NET Provider Model (Creating Custom Membership and Role Providers) - Part 3
解决Ehcache缓存警告问题
冰绿茶 · 2014-07-08 · via 博客园 - 冰绿茶

警告: 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.

需要设置2个地方解决这个问题

1.hibernate.cache.region.factory_class=org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory

注意需要是Singleton的EhCacheRegionFactory

2.Spring EhCache Beans配置

<bean id="cacheManager" class="org.springframework.cache.ehcache.EhCacheCacheManager">
<property name="cacheManager" ref="ehcache"/>
</bean>

<bean id="ehcache" class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean">
<property name="shared" value="true"/>
<property name="configLocation" value="classpath:ehcache.xml"/>
</bean>

注意这里一定要设置shared为true