Ehcache元素< cache />不允许属性“ transactionalMode”? [英] Ehcache element <cache/> does not allow attribute "transactionalMode"?
问题描述
根据 Ehcache文档,从2.0版开始,Ehcache缓存可以参与基于属性 transactionalMode $ c的值的 JTA 事务
According to the Ehcache documentation, starting with version 2.0, an Ehcache cache may participate in a JTA transaction based on the value of attribute transactionalMode
on element <cache/>
.
如果元素为< cache />
。当它在我的Ehcache配置文件中遇到此属性时,引发以下异常并抱怨元素不允许属性 transactionalMode。:
If this is true, then why does Ehcache, when it encounters this attribute in my Ehcache configuration file, throw the following exception and complain that "Element does not allow attribute "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 $ c中的示例缓存定义$ c>文件,其中我已将
transactionalMode
设置为 xa:
Here is a sample cache definition from my ehcache.xml
file in which I've set transactionalMode
to "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 ,因为休眠Ehcache集成3.3.2.GA 需要Ehcache 1.2.3。
Turns out that Maven had also included Ehcache 1.2.3 in my project EAR file because Hibernate Ehcache Integration 3.3.2.GA requires Ehcache 1.2.3.
这篇关于Ehcache元素< cache />不允许属性“ transactionalMode”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!