0 Replies Latest reply on Dec 4, 2015 11:42 AM by Alexandre Soares

    Use @Resource on Spring Bean to inject Infinispan CacheContainer

    Alexandre Soares Newbie

      Hi everyone,


      I'm developing a Java application using Jboss EAP 6.4 with Infinispan CACHE. After I configured the Infinispan on standalone-full.xml I started the JBOSS and the Infinispan JNDI was registered ok in jboss configs like below:


              <subsystem xmlns="urn:jboss:domain:ee:1.2">
                      <module name="org.infinispan" slot="main"/>




      <subsystem xmlns="urn:jboss:domain:infinispan:1.5">            
           <cache-container name="programasus" default-cache="local" start="EAGER" >
                <local-cache name="local"/>


      After that I tried to inject the CacheContainer on my Spring Bean:


      public final class CacheMunicipiosUf {
        /** The cache. It must configured in Server. */
        @Resource(lookup = "java:jboss/infinispan/container/programasus")
        private CacheContainer cacheContainer;


      Every time that I deploy that application the CacheContainer is null. Can anyone help me on that? Does anybody know if @Resource works on Spring Bean to locate Infinispan container?