2 Replies Latest reply on Mar 24, 2012 9:53 AM by carmelo

    Infinispan Cache javax.naming.NameNotFoundException in Singleton @PostConstruct method

    carmelo

      I,m trying to retrieve infinispan cache via jndi in @PostConstruct method of Singleton EJB marked with @Startup and i have the following issue :

       

       

       

       

       

      ..........LoadingChainCommonException: javax.naming.NameNotFoundException: Error looking up infinispan/cluster, service service jboss.naming.context.java.jboss.infinispan.cluster is not started

              at com.xxx.loadingchain.common.ContextTool.lookupLocal(ContextTool.java:49)

              at com.xxx.loadingchain.common.shared.SharedCacheContainer.<init>(SharedCacheContainer.java:16)

              at com.xxx.loadingchain.common.shared.SharedCacheContainer.getInstance(SharedCacheContainer.java:23)

              at com.xxx.loader.manager.CacheManager.checkForInitialization(CacheManager.java:53)

              at com.xxx.loader.manager.InitializationManagerBean.addInitToken(InitializationManagerBean.java:39)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_30]

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_30]

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_30]

              at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_30]

              at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptorFactory$ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptorFactory.java:130)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

              at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

              at org.jboss.as.ee.component.ManagedReferenceInterceptorFactory$ManagedReferenceInterceptor.processInvocation(ManagedReferenceInterceptorFactory.java:95)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

              at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

              at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

              at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:228)

              at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:333)

              at org.jboss.as.ejb3.tx.SingletonLifecycleCMTTxInterceptor.processInvocation(SingletonLifecycleCMTTxInterceptor.java:56)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

              at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

              at org.jboss.as.ee.component.TCCLInterceptor.processInvocation(TCCLInterceptor.java:45)

              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:288)

              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)

              ... 9 more

      Caused by: javax.naming.NameNotFoundException: Error looking up infinispan/cluster, service service jboss.naming.context.java.jboss.infinispan.cluster is not started

              at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:126)

              at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:74)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

              at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:123)

              at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)

              at javax.naming.InitialContext.lookup(InitialContext.java:392) [rt.jar:1.6.0_30]

              at com.xxx.loadingchain.common.ContextTool.lookupLocal(ContextTool.java:46)

              ... 37 more

       

       

      My cache configuration is the default configuration of standalone-full-ha.xml , I have only added start="EAGER" and jndi-name to the cache-container configuration :

      .............

      <subsystem xmlns="urn:jboss:domain:infinispan:1.2" default-cache-container="cluster">

                  <cache-container name="cluster" default-cache="default" jndi-name="java:jboss/infinispan/cluster" start="EAGER">

                      <transport lock-timeout="60000"/>

                      <replicated-cache name="default" mode="SYNC" batching="true">

                          <locking isolation="REPEATABLE_READ"/>

                      </replicated-cache>

                  </cache-container>

       

      ........................   .

       

      If I perform an hot deploy of my application the problems does not occur.

      I noticed that if cache container is configured to start lazily the error occurs when I perform the hot deploy too!!

       

      Have any idea about this issue?

       

      Thanks