gpt4 book ai didi

configuration - Ehcache 元素 不允许属性 "transactionalMode"?

转载 作者:行者123 更新时间:2023-12-04 06:47:21 27 4
gpt4 key购买 nike

根据Ehcache documentation ,从 2.0 版本开始,一个 Ehcache 缓存可能会参与 JTA基于属性值的交易transactionalMode关于元素 <cache/> .

如果这是真的,那么为什么 Ehcache 在我的 Ehcache 配置文件中遇到此属性时,会抛出以下异常并提示“元素不允许属性“transactionalMode”。”:

Caused by: net.sf.ehcache.CacheException: Error configuring from zip:C:/Program Files/Oracle/Middleware/user_projects/domains/abstrack1/servers/AdminServer/tmp/_WL_user/_appsdir_middleware-ear-1.0-SNAPSHOT_ear/n8rga7/middleware-ejb-1.0-SNAPSHOT.jar!/ehcache.xml. Initial cause was Error configuring from input stream. Initial cause was null:35: Element <cache> does not allow attribute "transactionalMode".
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:95)
at net.sf.ehcache.config.ConfigurationFactory.parseConfiguration(ConfigurationFactory.java:131)
at net.sf.ehcache.CacheManager.parseConfiguration(CacheManager.java:241)
at net.sf.ehcache.CacheManager.init(CacheManager.java:190)
at net.sf.ehcache.CacheManager.<init>(CacheManager.java:183)
at net.sf.ehcache.hibernate.EhCacheProvider.start(EhCacheProvider.java:128)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1291)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:814)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:732)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 76 more]]>

这是我的 ehcache.xml 中的示例缓存定义我在其中设置的文件 transactionalMode到“xa”:
<cache
name="com.db.spgit.abstrack.model.Security"
maxElementsInMemory="500"
eternal="false"
timeToIdleSeconds="300"
timeToLiveSeconds="86400"
overflowToDisk="false"
transactionalMode="xa" />

最佳答案

原来 Maven 也包含了 Ehcache 1.2.3在我的项目 EAR 文件中,因为 Hibernate Ehcache Integration 3.3.2.GA需要 Ehcache 1.2.3。

关于configuration - Ehcache 元素 <cache/> 不允许属性 "transactionalMode"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3560659/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com