3

I have implemented caching in my Spring application and when I run it locally everything works fine. I have infinispan.xml configuration in resources and the following configuration:

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. I have defined my cache container with jndi-name=infinispan/CONTAINER.

I tried setting spring.cache.infinispan.config to:

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?

dplesa
  • 1,355
  • 6
  • 23
  • 56

1 Answers1

1

As far as I know, this is not possible at the moment.

You will need to extend SpringEmbeddedCacheManagerFactoryBean and override #createBackingEmbeddedCacheManager() method. Then use JndiTemplate to grab a reference to EmbeddedCacheManager deployed in WildFly (similarly to this thread).

I also created ISPN-7208 to allow specifying JNDI references for Cache Managers.

Community
  • 1
  • 1
Sebastian Łaskawiec
  • 2,667
  • 15
  • 33