Hibernate框架使用中出现could not instantiate RegionFactory 异常的解决方法
来源:互联网 发布:网络电视机那个牌子好 编辑:程序博客网 时间:2024/05/16 01:43
二级缓存配置如下:
<!-- 指定要使用的缓存的提供商,打开二级缓存--><property name="hibernate.cache.use_second_level_cache"> true</property><property name="hibernate.cache.provider_class"> org.hibernate.cache.EhCacheProvider</property><!-- 开启使用查询缓存 --><property name="cache.use_query_cache">true</property>
如果使用了org.hibernate.cache.EhCacheProvider缓存相关的类请先检查项目所引用的库包含哪些jar包
要使用二级缓存所需要使用的库如下所示:
抛could not instantiate RegionFactory异常时本人引用的库
如果是缺少方框内的jar包导致的异常,没有时间后面的内容可以不看,后面内容主要分析出错原因。
具体原因分析如下:
来看一下抛出的异常:
重点在方框里
可以看出抛异常是因为缺少所需要的类,按照提示是缺少了跟异常有关的jar包,因此需要在构建路径里添加ehcache-2.10.3.jar
导入ehcache-2.10.3.jar包还抛如下异常
java.lang.NoClassDefFoundError:org/apache/commons/logging/LogFactory
表明缺少了commons-logging-1...jar包导入该jar包便不会抛出此异常了
如果还出现如下异常
则需再把backport-util-concurrent.jar包添加到构建路径便可以了
0 0
- Hibernate框架使用中出现could not instantiate RegionFactory 异常的解决方法
- org.hibernate.HibernateException: could not instantiate RegionFactory
- could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridg
- could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridg
- could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBrid
- org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl.brid
- hibernate二级缓存报错could not instantiate RegionFactory [org.hibernate.cache.impl.bridge.RegionFactoryCac
- ibatis sql_Map中出现异常:Cause: java.lang.RuntimeException: JavaBeansDataExchange could not instantiate..
- ibatis sql_Map中出现异常:Cause: java.lang.RuntimeException: JavaBeansDataExchange could not instantiate..
- hibernate -----Could not instantiate cache implementation异常处理
- hibernate -----Could not instantiate cache implementation异常处理
- Hibernate 使用时出现 Could not parse configuration: /hibernate.cfg.xml 的异常问题
- 使用Hibernate时出现“could not execute query”异常
- 使用JCS时出现config.OptionConverter - Could not instantiate class []的错误原因
- hibernate-------could not instantiate id generator
- xcode 4.5.2 中使用 ios 6 skd iOS/Xcode异常:reason: ‘Could not instantiate class named NSLayoutConstraint’
- 使用apt-get出现“Could not get lock...”的解决方法
- hibernate出现异常org.hibernate.exception.SQLGrammarException:could not execute
- C++ operator关键字(重载操作符)
- javascript的位置:<head>或者<body>
- java单链表reverse
- Unity说明文档翻译-Getting Started
- leetcode500: Keyboard Row
- Hibernate框架使用中出现could not instantiate RegionFactory 异常的解决方法
- 线程同步-CountDownLatch
- 监督学习-k近邻算法模板
- windows下编译wireshark错误
- MySql学习(七) —— 查询性能优化 深入理解MySql如何执行查询
- HTML5属性扩展总结
- 程序员道路
- JSON和XML的利弊
- Unity3D中Layers和LayerMask解析