您的位置:首页 > 其它

Hibernate 异常CacheException: Another unnamed CacheManager already exists in the same VM

2017-05-01 21:04 411 查看
原因:

ehcache在2.5以后,CacheManager使用了Singleton,这样在创建多个CacheManager时就会产生上述错误。

解决方法:



<property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>


改成

<property name="hibernate.cache.region.factory_class">org.hibernate.cache.SingletonEhCacheRegionFactory
</property>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐