ehcache2.5后hibernate多SessionFactory报错的解决
来源:互联网 发布:linux mount u盘 编辑:程序博客网 时间:2024/05/22 06:08
原文:http://blog.sina.com.cn/s/blog_6e0810c701014dmv.html
今天在项目中配置多SessionFactory,抛错
Caused by: net.sf.ehcache.CacheException: Another unnamed CacheManager already exists in the same VM. Please provide unique names for each CacheManager in the config or do one of following:
1. Use one of the CacheManager.create() static factory methods to reuse same CacheManager with same name or create one if necessary
2. Shutdown the earlier cacheManager before creating new one with same name.
经查,ehcache在2.5以后,CacheManager使用了Singleton,这样在创建多个CacheManager时就会产生上述错误。
http://ehcache.org/documentation/get-started/concepts 是官方解释
解决方法是在Hibernate的hibernateProperties配置中,加上
<prop key="hibernate.cache.region.factory_class">
</prop>
0 0
- ehcache2.5后hibernate多SessionFactory报错的解决
- ehcache2.5后hibernate多SessionFactory报错的解决
- ehcache2.5后hibernate多SessionFactory报错的解决
- ehcache2.5后hibernate多SessionFactory报错的解决
- ehcache2.5后hibernate多SessionFactory报错的解决(Another unnamed CacheManager )
- 关于Hibernate 5 和 Hibernate 4 在创建SessionFactory的不同点分析(解决 org.hibernate.MappingException: Unknown entit
- Hibernate的Transaction SessionFactory
- Hibernate 的 SessionFactory接口
- Hibernate的sessionFactory
- sessionFactory.getCurrentSession()报错
- Hibernate报错解决
- hibernate 的SessionFactory的实现
- Hibernate的sessionFactory的封装
- Hibernate 中 SessionFactory的创建
- hibernate中SessionFactory的创建
- Hibernate的SessionFactory、Session介绍
- Hibernate的核心接口:SessionFactory
- hibernate SessionFactory的获取方法
- 使用函数模版作为函数参数
- 总结C#获取当前路径的7种方法
- android权限大全
- android PercentRelativeLayout 支持百分比来设置控件的宽高
- 关于caffe-windows中 compute_image_mean.exe出现的问题
- ehcache2.5后hibernate多SessionFactory报错的解决
- Eclipse jar包不能放在一个文件夹
- 让我们一起Go(五)
- ERROR ITMS-9000: "Redundant Binary Upload. There already exists a binary upload with build version '
- 经典SQL语句大全
- DevExpress2011控件教程)编辑控件(comboBox,AspxCheckBox) 范例1
- 负载均衡
- 《Java程序设计》第16周周四:GUI编程及文件对话框的使用
- UIScrollView的简单使用