Hibernate版本4.1.2
Encache版本2.4.3
异常信息:[main] ERROR com.ryan.HibernateUtil - Initial SessionFactory creation failed: org.hibernate.cache.NoCacheRegionFactoryAvailableException:
Second-level cache is used in the application,
but property hibernate.cache.region.factory_classis not gaven,
please either disable second level cache or set correct region factory class name to property hibernate.cache.region.factory_class
(and make sure the second level cache provider, hibernate-infinispan, for example, available in the classpath).hibernate.cfg.xml里是这么配的:<property name="cache.use_second_level_cache">true</property>
<property name="cache.provider_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>
<property name="cache.use_query_cache">true</property>需要的库都在classpath下了,看报错应该是hibernate.cache.region.factory_classis这个property没有配置,但是找遍了hibernate文档也没找到这个配置是什么。
Encache版本2.4.3
异常信息:[main] ERROR com.ryan.HibernateUtil - Initial SessionFactory creation failed: org.hibernate.cache.NoCacheRegionFactoryAvailableException:
Second-level cache is used in the application,
but property hibernate.cache.region.factory_classis not gaven,
please either disable second level cache or set correct region factory class name to property hibernate.cache.region.factory_class
(and make sure the second level cache provider, hibernate-infinispan, for example, available in the classpath).hibernate.cfg.xml里是这么配的:<property name="cache.use_second_level_cache">true</property>
<property name="cache.provider_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>
<property name="cache.use_query_cache">true</property>需要的库都在classpath下了,看报错应该是hibernate.cache.region.factory_classis这个property没有配置,但是找遍了hibernate文档也没找到这个配置是什么。
解决方案 »
- ${ }如何嵌入JSP表达式中?
- 关于jsp和servlet的问题?
- struts如何静态和动态分离?
- 在Action中输出JS提示对话框
- 关于struts的问题
- 各位帮主,提问如下:为什么将一个String类的实例作为参数传递时竟然结果是传值而不是
- tomcat 5.5 的一个问题
- 编译无状态会话Bean时出现错误:Spaces in the temporary directory path may cause WebLogic APPC utility to produce fatal compile er
- 如何用JavaScript取和设置Struts中<html:text property="tt" value="ddddd">的value值
- 菜鸟求问jpa/spring的@Resource的原理是怎样的
- 一个线程中有多个方法,如何让它执行完其中一个再去执行别的
- java webservice 都用什么技术实现?
ATTENTION HIBERNATE 3.2 USERS: Make sure to note the change to BOTH the property name and value.
Use:<property name="hibernate.cache.region.factory_class">
net.sf.ehcache.hibernate.EhCacheRegionFactory</property>
只在Ehcache的文档里提到了新语法
<!-- 应用二级缓存 -->
<property name="hibernate.cache.use_second_level_cache">true</property>
<!-- 缓存的驱动类 -->
<property name="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.EhCacheRegionFactory</property>这样就可以啦