`
zha_zi
  • 浏览: 592662 次
  • 性别: Icon_minigender_1
  • 来自: 西安
社区版块
存档分类
最新评论

org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled

阅读更多

     最近在学新jbpm开源工作流,学习过程非常不顺利,版本太复杂,乱七八糟 把按照教程上的说明把4.2的jar包拷进去

做了一个最贱单的例子死活就是 不能运行,发现网上大部分的教程都是3.2,没办法换了一个开发包,发现连个开发包里边的东西名字和分类都不是太一样,仍旧是那个最简单的例子还是不能运行

    抛出一个org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]的异常

 

org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
	at org.hibernate.cache.NoCacheProvider.buildCache(NoCacheProvider.java:21)
	at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:61)
	at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:214)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
	at org.jbpm.persistence.db.DbPersistenceServiceFactory.getSessionFactory(DbPersistenceServiceFactory.java:91)
	at org.jbpm.persistence.db.DbPersistenceService.getSessionFactory(DbPersistenceService.java:95)
	at org.jbpm.persistence.db.DbPersistenceService.getSession(DbPersistenceService.java:99)
	at org.jbpm.persistence.db.DbPersistenceService.getGraphSession(DbPersistenceService.java:341)
	at org.jbpm.JbpmContext.getGraphSession(JbpmContext.java:571)
	at org.jbpm.JbpmContext.deployProcessDefinition(JbpmContext.java:173)
	at org.apache.jsp.index_jsp._jspService(index_jsp.java:87)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
	at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
	at java.lang.Thread.run(Unknown Source)

 

   折腾了半天 终于解决了,是没有二级缓存jar的问题  <property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>

  这个配置一下就ok了,

    我的二级缓存名字叫 ehcache-1.2.3.jar 配置上还是不行 好像是jar版本问题

最后我直接把二级缓存和查询缓存禁用了ok了

 

 

 

 

分享到:
评论
3 楼 goldapple 2012-03-19  
<property name="hibernate.cache.region.factory_class" value="org.hibernate.cache.ehcache.EhCacheRegionFactory"/>
2 楼 zha_zi 2010-11-29  
哥们我这是3.2配置启动的问题,你看看你的是什么版本的4.0以上的已经完全不一样了
1 楼 petitlen 2010-11-27  
这算什么解决问题,还是没有配置成2级缓存

相关推荐

Global site tag (gtag.js) - Google Analytics