Infinispan上的JBoss缓存配置

时间:2018-10-01 16:22:36

标签: caching jboss infinispan spring-cache jcache

我有这个错误

Caused by: org.springframework.jndi.TypeMismatchNamingException: Object of type [class org.jboss.as.clustering.infinispan.DefaultCacheContainer] available at JNDI location [java:jboss/infinispan/container/mana
ger] is not assignable to [org.infinispan.manager.EmbeddedCacheManager]
        at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:182)
        at org.springframework.jndi.JndiLocatorSupport.lookup(JndiLocatorSupport.java:95)
        at org.springframework.jndi.JndiObjectLocator.lookup(JndiObjectLocator.java:106)
        at org.springframework.jndi.JndiObjectFactoryBean.lookupWithFallback(JndiObjectFactoryBean.java:231)
        at org.springframework.jndi.JndiObjectFactoryBean.afterPropertiesSet(JndiObjectFactoryBean.java:217)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1692)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1630)
        ... 144 more

使用此配置

<bean id="phoenixCacheBean" class="org.infinispan.spring.provider.SpringEmbeddedCacheManager">
    <constructor-arg>
        <jee:jndi-lookup id="infinispanCacheConfig" jndi-name="${jndi.infinispan}" resource-ref="true" expected-type="org.infinispan.manager.EmbeddedCacheManager"/>
    </constructor-arg>
</bean>

但是DefaultCacheContainer实现了EmbeddedCacheManager。

<cache-container name="manager" default-cache="repl" module="org.wildfly.clustering.web.infinispan">
        <transport lock-timeout="60000"/>
        <replicated-cache name="repl" mode="SYNC">
               <locking isolation="READ_COMMITTED"/>
               <transaction locking="OPTIMISTIC" mode="BATCH"/>
               <file-store/>
        </replicated-cache>
</cache-container>

我不希望删除资源引用。

我找到另一个有这个问题的人 https://developer.jboss.org/thread/277444

您有建议吗?

谢谢。

米歇尔

0 个答案:

没有答案