JBPM Hibernate cache

The content of element type "session-factory" must match "(property*,mapping*,(class-cache|collectio exception org.hibernate.MappingException: invalid configuration org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1487) org.hibernate.cfg.Configuration.configure(Configuration.jav 阅读详情

org.hibernate.HibernateException: Could not instantiate cache implementation

at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:64)

at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:214)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)

at jbpm.jbpmTest.testHibernate(jbpmTest.java:31)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at junit.framework.TestCase.runTest(TestCase.java:168)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at junit.framework.TestSuite.runTest(TestSuite.java:232)

at junit.framework.TestSuite.run(TestSuite.java:227)

at org.junit.internal.runners.OldTestClassRunner.run(OldTestClassRunner.java:76)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

Caused by: 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)

... 22 more

Apparently the cacheimplementationcould not been found or it was expecting some configuration properties which where not set. I checked in my deploy/lib directory and the ehcache.jar was there. I started to modify the hibernate.hbm.xml which was basically the one from the jbpm examples and which was not working.

First successful try:
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.cache.use_query_cache">false</property>
This seems to work, however it disables all the cache which is not exactly what I want.

Second successful try:

<property name="hibernate.cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
<!--
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.cache.use_query_cache">false</property>
-->

In the mean time I also tried:

<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<!--
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.cache.use_query_cache">false</property>
-->

which also worked.
Apparently all was related to this in hibernate documentation, as it seems EhCache is no longer a default implementation and this was what JPBM was complaing about:

"You have the option to tell Hibernate which caching implementation to use by specifying the name of a class that implements org.hibernate.cache.CacheProvider  using the property hibernate.cache.provider_class. ... Note that versions prior to 3.2 defaulted to use EhCache as the default cache provider; that is no longer the case as of 3.2."

Warning: just undeploying/deploying the sar gave me very unreplicable results. The only way I could verify the configuration correctly each way was to restart the container :((

Links with helped me with this:

高性能优化的本质 在很早之前,处理器性能的提升一般是通过减小元器件的尺寸,增加元器件的数量,提高主频来实现,这也是摩尔定律所说的,但是由于功耗的影响,主频不能一直增加。后来,由于英伟达的GPU的并行计算的出现,逐渐打破摩尔定律,人们利用多核,SIMD,SIMT来处理大量相同计算的数据,这极大的提高了效率。计算机的算力得到了巨大的提升,但是并行是困难的,对于有数据依赖的程序来说,处理并行是一件及其困难的事,但对于一些简单的数学库的计算,并行的实现相对简单。 阅读详情

相关推荐

Android Camera性能优化概述

做camera性能优化方面的工作有几年了,想写一篇文章简单介绍一下其中涉及到的具体技术,这篇文章会大概介绍一下涉及到的技术。

weixin_42136255的博客 4028

jbpm二级缓存异常解决

异常:org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache] 大概意思是二级缓存不可用,但是项目在开发阶段不需要启...

nigat的博客 157

433M遥控器无线解码1527协议

433M遥控器无线解码1527协议,定时器轮询法

weixin_58595117的博客 1万+

JBPM4.4整合hibernate4所遇到的所有问题

 1.       问题1:a)       报错:                       i.             java.lang.NoClassDefFoundError:org/hibernate/impl/SessionImplb)       原因:                       i.             JBPM4默认使用的Hibernate3,Hibe...

familylammy的博客 919

Cadence——原理图相关教程

包含创建文件,原理图,元器件,规则检查,PDF与BOM清单输出,各类PCB网表

haonanyayaya的博客 1万+

国产谷歌地球,地形分析秒杀同款地图软件

咱们做地质、林业、水文、水利、电力、GIS、地图、水保、环境的,需要经常用到各种数据,比如影像、地形、矢量、模型等,但目前80%的规划大数据展示都离不开ArcGIS,令人头大的是很多朋友连ArcGIS软件安装起来都费劲。。。 那不会ArcGIS又装不了Google Earth怎么开展工作? 今天推荐大家一款国产免费专业地图浏览下载测量分析神器—图新地球 图新地球,国产三维gis软件。可以查看高清卫星影像地形以及其他很多常用电子地图,对地图需求的掌握远胜过Google Maps,而且上手比国外软件要简单

GISWorld3D的博客 3687

根据调试信息学习jbpm(二):sessionFactory

下面是调用persistenceSessionFactory.openPersistenceSession()时后台的debug信息,从这里我们可以学习到两点:1)jbpm的表结构是什么样的,看hbm文件就可以了2)jbpm怎么样使用hibernate的,如使用了什么优化器,使用的什么连接池等15:11:33,653 DEBUG HibernateSessionFactory : creating...

【洪波@阿里云】 117

ComfyUI节点流实战:用Wan2.1制作电商短视频全流程(附人物/商品模板)

本文提供了一份详尽的ComfyUI实战教程,指导用户如何利用通义万相Wan2.1图生视频模型,高效制作适用于抖音等平台的电商短视频。内容涵盖从环境部署、核心工作流搭建,到针对服装、3C数码等品类的高级提示词模板与参数调优,旨在帮助电商从业者快速生成高质量、高保真商品展示视频,显著提升内容生产效率。

potato的博客 1287

[Java web]Could not find configuration [org.hibernate.cache.UpdateTimestampsCache]; using defaults

No configuration found. Configuring ehcache from ehcache-failsafe.xml 。ehcache-failsafe.xml 是来自于ehcache-1.1.jar包,但原因并不是找不到 ehcache-failsafe.xml 而造成的错误,把 ehcache-1.1.jar包里的 ehcache-failsafe.xml 抽取出来,改名

1279

【智能优化算法】2024年SCI鳗鱼-石斑鱼优化算法(EGO),含MathType公式、word伪代码、visio流程图、matlab代码等。

该文中包括5个内容:用MathType编辑的公式、伪代码、visio的流程图,matlab代码,PDF论文,拿来直接用,可以帮助科研者省下超多时间。 鳗鱼-石斑鱼优化算法(Eel and grouper optimizer ,EGO)是一种新型的元启发式算法(智能优化算法),灵感来源于海洋生态系统中鳗鱼和石斑鱼的共生作用和觅食策略。该成果由Ali Mohammadzadeh和Seyedali Mirjalili两位作者于2024年6月发表在SCI著名期刊《Cluster Computing》上。

2301_79359347的博客 1044

AI Agent的知识蒸馏链:多阶段LLM模型优化

随着大语言模型(LLM)规模的不断扩大,如何在保持模型性能的同时提高其部署效率成为关键挑战。本文旨在探讨通过知识蒸馏技术构建多阶段优化链,实现LLM模型的高效压缩和性能优化。研究范围涵盖从基础理论到实际应用的完整知识蒸馏流程,特别关注AI Agent场景下的特殊需求和解决方案。本文首先介绍知识蒸馏的基本概念和背景,然后详细阐述多阶段蒸馏链的核心原理。接着,我们将深入探讨算法实现细节和数学模型,提供完整的代码示例。最后讨论实际应用、工具资源和未来发展方向。

AI大模型应用之禅 354

jbpm发布时的异常

1 Q 13:54:14,453 [main] ERROR ErrorCounter : *** ERROR: line 3:43: expecting "set", found 't' 13:54:14,468 [main] ERROR ErrorCounter : *** ERROR: line 3:43: expecting "set", found 't' 13:54:14,484 [ma...

老别 168

华东理工大学计算机预推免面试

华东理工大学预推免面试经验分享

D1379951481的博客 1405

jbpm的启动cache 异常

jbpm的缓存问题。:   http://hi.baidu.com/freshman0502/blog/item/a76dd982a0bda295f703a659.html 提示:jbpm所需要的包: 核心jBPM代码唯一相关的库是commons logging. 其他的库都是可选的. 当然, xml解析和永久化依赖其他的库. 大多数的jBPM的发布依赖hibernate 3.0 库来做永久化...

喜糖 的专栏 166

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

STM32F407中文手册

STM32f407中文手册 本参考手册面向应用开发人员,提供有关使用 STM32F405xx/07xx、STM32F415xx/17xx、 STM32F42xxx 和 STM32F43xxx 微控制器存储器与外设的完整信息。STM32F405xx/07xx、STM32F415xx/17xx、STM32F42xxx 和 STM32F43xxx 构成一个微 控制器系列,各产品具有不同的存储器大小、封装和外设。有关订购信息以及器件的机械与电气特性,请参见数据手册。有关 ARM Cortex™-M4F 内核的信息,请参见《Cortex™-M4F 技术参考手册》。

关于Spring3与Hibernate4整合错误:java.lang.NoClassDefFoundError: org/hibernate/cache/CacheProvider

主要异常信息: Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: I

selaginella的专栏 7025

文档:亲测可用解决vnc灰屏,黑屏,鼠标大黑叉情况

主要解决vnc-viewer灰屏,黑屏,鼠标大黑叉等现象,详细见文档。

Hibernate 里 SQL 和 HQL,Criteria Query 对Session Cache缓存使用的不同

现在在做JBPM,JBPM里面有个接口是History Process Instance Query。 后来有需求查找的时候要和实际业务中的数据关联,考虑到性能,希望把业务表和JBPM的表关联起来,所以我扩展了一下这个接口,用的也是JBPM的Command模板,调用CommandService执行,不同就只是我写的是SQL,JBPM用的是HQL。今天出现了个异常,我们创建了一个Process,在没结束前,立即用我写的那个接口去查,发现查不到刚创建的那条数据,很奇怪。理论上来说,虽然数据没有被commit到d

纸做原创 5098

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

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

最近在学新jbpm开源工作流,学习过程非常不顺利,版本太复杂,乱七八糟 把按照教程上的说明把4.2的jar包拷进去 做了一个最贱单的例子死活就是 不能运行,发现网上大部分的教程都是3.2,没办法换了一个开发包,发现连个开发包里边的东西名字和分类都不是太一样,仍旧是那个最简单的例子还是不能运行     抛出一个org.hibernate.cache.NoCachingEnabledExcepti

zha_zi的专栏 753

Cannot cache an unknown entity: java.runtime.name

将Spring2.5的Jar包换成3.2以后hibernate出现异常 Invocation of init method failed; nested exception is org.hibernate.MappingException: Cannot cache an unknown entity: java.runtime.name我的应该是Cache配置出错了。把下面CODE加上就OK了...

Kevin的足跡 418

Hibernate的缓存处理

20.2.1. 缓存映射(Cache mappings) 类或者集合映射的“元素”可以有下列形式: <cache usage="transactional|read-write|nonstrict-read-write|read-only" (1)/> (1)

tutugogo的专栏 3374

解决ClassNotFoundException: org.hibernate.hql.ast.HqlToken

<br />由于项目需要,近日正对jBPM4.0进行研究。在试图将工作流发布到WebLogic11g即WebLogic10.3中时遇到了比较棘手的异常:ClassNotFoundException: org.hibernate.hql.ast.HqlToken,在经过查询资料并进行代码追踪和研究后发现产生该异常的原因是:在jBPM4.0中,使用的Hibernate是3.0之后的版本,而从3.0开始就采用了新的基于ANTLR的查询翻译器,在WebLogic中使用的是antlr2.6.1.jar,无法满足该要求

Mr. David 专栏 1047
上一篇: Hibernate Annotation
下一篇: 基础
shendaiming
博客等级 码龄20年 18粉丝 32原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值