1

I am trying to enable infinispan cache in Wildfly 9. I modified standalone-full.xml under:

<subsystem xmlns="urn:jboss:domain:infinispan:3.0">

<cache-container name="myCache" jndi-name="java:jboss/infinispan/container/myCache">
            <local-cache name="cachedb"/>
        </cache-container>

Started server using bellow command:

standalone --server-config=standalone-full.xml -b 0.0.0.0

And getting following error:

Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.infinispan.manager.CacheContainer] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, lookup=java:jboss/infinispan/container/myCache, name=, description=, authenticationType=CONTAINER, type=class java.lang.Object, mappedName=)}

Hiura
  • 3,500
  • 2
  • 20
  • 39
Nomeswaran
  • 1,831
  • 2
  • 10
  • 7

1 Answers1

1

the jndi-name seems to be wrong. As shown in this quickstart, you need to update the configuration as follows:

<cache-container name="myCacheContainer" default-cache="myCache">
    <local-cache name="myCache"/>
</cache-container>

And use the following code snippet for injection:

@Resource(lookup="java:jboss/infinispan/container/myCacheContainer")
private static EmbeddedCacheManager container;

I see Spring in the stacktrace so probably you will need to do something similar there.

Sebastian Łaskawiec
  • 2,667
  • 15
  • 33