简体   繁体   English

Spring和WildFly Infinispan缓存查找

[英]Spring and WildFly Infinispan cache lookup

I have implemented caching in my Spring application and when I run it locally everything works fine. 我在Spring应用程序中实现了缓存,当我在本地运行它时,一切正常。 I have infinispan.xml configuration in resources and the following configuration: 我在资源中有infinispan.xml配置和以下配置:

spring.cache.type=infinispan
spring.cache.infinispan.config=classpath:infinispan.xml

Now I would like to deploy it to WildFly 10 and to use built in cache. 现在我想将它部署到WildFly 10并使用内置缓存。 I have defined my cache container with jndi-name=infinispan/CONTAINER . 我用jndi-name=infinispan/CONTAINER定义了我的缓存容器。

I tried setting spring.cache.infinispan.config to: 我尝试将spring.cache.infinispan.config设置为:

infinispan/CONTAINER
java:/infinispan/CONTAINER
java:jboss/infinispan/CONTAINER

But I allways get the following error: 但我总是得到以下错误:

java.lang.IllegalArgumentException: Cache configuration does not exist 

What should I do make this work? 我该怎么做才能使这个工作?

As far as I know, this is not possible at the moment. 据我所知,目前这是不可能的。

You will need to extend SpringEmbeddedCacheManagerFactoryBean and override #createBackingEmbeddedCacheManager() method. 您将需要扩展SpringEmbeddedCacheManagerFactoryBean并覆盖#createBackingEmbeddedCacheManager()方法。 Then use JndiTemplate to grab a reference to EmbeddedCacheManager deployed in WildFly (similarly to this thread ). 然后使用JndiTemplate获取对WildFly中部署的EmbeddedCacheManager的引用(类似于此线程 )。

I also created ISPN-7208 to allow specifying JNDI references for Cache Managers. 我还创建了ISPN-7208以允许为Cache Manager指定JNDI引用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM