1 2 Previous Next 15 Replies Latest reply on Mar 27, 2012 1:07 PM by Rahul Gagrani

    Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!

    Diego Silveira Newbie

      Jboss and Infinispan gurus,

       

      I'm using Infinispan shipped with JBoss AS 7.1.1.Final (i.e. Infinispan 5.1.2.Final). My JBoss is configured in domain mode, with 1 domain controller (master) and 1 host controller (slave).

       

      I just got the org.infinispan.CacheContainer instance by JNDI lookup, and this cache-container is declared in domain.xml. From this CacheContainer instance, I call getCache( "myCache" ) method to get an org.infinispan.Cache instance. The app retrieves this Cache instance properly, both on domain controller and on host controller and I'm able to call lock( key ) and put( key, value ) successfuly.

       

      The problem is on host controller (slave): When I try to get the "myCache"instance from injected CacheContainer, I always get an empty (no keys) cache instance, the key/value pairs stored previously are lost. On domain controller, everything works fine.

       

      Here is the Cache daclaration (domain.xml):

       

      <cache-container name="myCacheContainer" jndi-name="java:jboss/infinispan/myCacheContainer">
         <transport lock-timeout="60000" />
         <replicated-cache name="myCache" mode="SYNC" batching="false">
            <transaction mode=FULL_XA" locking="PESSIMISTIC"/>
            <eviction strategy="NONE" />
            <expiration max-idle="-1" lifespan="-1" />
         </replicated-cache>
      </cache-container>
      

       

      PS: JTA transactions are enabled on methods that manipulates the cache and cache container!

       

      Thank you!

        • 1. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
          Kabir Khan Master

          I think you're saying you're not seeing things put in to the master on the slave, I think the problem is that there was a slight change meaning you have to include a <transport> element in your cache container to enable the replicating behaviour - see jboss-as-infinispan_1_2.xsd for more details.

          • 2. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
            Diego Silveira Newbie

            You're right Kabir.

             

            1) I can't see things put to the master on the slave.

            2) I can't see things put to the slave on the master.

            3) I can't see things put to the slave on the slave (on subsequent requests)

            4) I can see things put to the master on the master (on subsequent requests). This is the unique working scenario.

             

            So, the changes in cache are not being replicated from master to the slave, neither from the slave to the master. On the slave things are a little bit worse: changes are not even visible to the slave itself.

             

            This <transport> element is present at my cache-container definition: <transport lock-timeout="60000" />

             

            Sounds weird, do you think is this a bug?

             

            Thank you.


            • 3. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
              Kabir Khan Master

              3 sounds weird.

              I'm not actually familiar with any of this but for the others I think the transport needs linking up with the jgroups 'stack', i.e. there are some other attributes in the xsd to set that. Looking at the jgroups section, I think 'udp' is the jgroups stack name you want. I see there is also a 'cluster' attribute, I'm not sure if that needs setting or not

              • 4. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                Richard Achmatowicz Novice

                Hi Diego

                Can you repeat this scenario and send me the server.log files from each of your two server instances. I'd like to investigate this issue further.

                Richard

                • 5. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                  Diego Silveira Newbie

                  Hello Richard,

                   

                  Changing a little the cache-container declaration in domain.xml as following solved this specific problem (empty cache on slave node). I just put the attribute start="EAGER".

                   

                  <cache-container name="myCacheContainer" jndi-name="java:jboss/infinispan/myCacheContainer" start=EAGER>
                     <transport lock-timeout="60000" />
                     <replicated-cache name="myCache" mode="SYNC" batching="false" start="EAGER">
                        <transaction mode=FULL_XA" locking="PESSIMISTIC"/>
                        <eviction strategy="NONE" />
                        <expiration max-idle="-1" lifespan="-1" />
                     </replicated-cache>
                  </cache-container>

                   

                  But now, there's another problem here:

                   

                  1) I can see changes put to the master on the master, if the first cache request was made on master.

                  2) I can see changes put to the slave on the slave,  if the first cache request was made on slave.

                  3) I can't see changes put to the master on the slave or changes put to the slave on the master. This ever leads to ClassNotFoundException, on cache value class which is packaged in my EAR (a JAR on the lib dir of the EAR).

                   

                  Here is the stacktrace for the CNFE:

                   

                  --- # --- # --- # ---

                  [Server:pd-master-vserver01] 16 Mar 2012 14:44:37,249 ERROR [br.com.buscape.pd.api.checkout.services.rest.TransactionRestResource] br.com.buscape.pd.log.api.Logger (http--10.10.100.39-8080-1) CONTROLLER :: TransactionRest.createTransaction -> Ocorreu um erro inesperado no sistema: {}

                  [Server:pd-master-vserver01] 16 Mar 2012 14:44:37,251 ERROR [br.com.buscape.pd.api.checkout.services.rest.TransactionRestResource] br.com.buscape.pd.log.api.Logger (http--10.10.100.39-8080-1) br.com.buscape.pd.cache.item.AcquirerRoutingCacheItem from [Module "org.jboss.as.clustering.infinispan:main" from local module loader @2393385d (roots: /opt/jboss/modules)]: java.lang.ClassNotFoundException: br.com.buscape.pd.cache.item.AcquirerRoutingCacheItem from [Module "org.jboss.as.clustering.infinispan:main" from local module loader @2393385d (roots: /opt/jboss/modules)]

                  [Server:pd-master-vserver01]           at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                  [Server:pd-master-vserver01]           at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                  [Server:pd-master-vserver01]           at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                  [Server:pd-master-vserver01]           at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

                  [Server:pd-master-vserver01]           at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                  [Server:pd-master-vserver01]           at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                  [Server:pd-master-vserver01]           at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at java.lang.Class.forName(Class.java:247) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at org.jboss.marshalling.AbstractClassResolver.loadClass(AbstractClassResolver.java:135)

                  [Server:pd-master-vserver01]           at org.jboss.marshalling.AbstractClassResolver.resolveClass(AbstractClassResolver.java:116)

                  [Server:pd-master-vserver01]           at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:892)

                  [Server:pd-master-vserver01]           at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1204)

                  [Server:pd-master-vserver01]           at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)

                  [Server:pd-master-vserver01]           at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)

                  [Server:pd-master-vserver01]           at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37)

                  [Server:pd-master-vserver01]           at org.infinispan.marshall.jboss.AbstractJBossMarshaller.objectFromObjectStream(AbstractJBossMarshaller.java:148) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.marshall.VersionAwareMarshaller.objectFromByteBuffer(VersionAwareMarshaller.java:110) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.marshall.AbstractMarshaller.objectFromByteBuffer(AbstractMarshaller.java:90) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.marshall.AbstractDelegatingMarshaller.objectFromByteBuffer(AbstractDelegatingMarshaller.java:79) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.marshall.MarshalledValue.deserialize0(MarshalledValue.java:154) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.marshall.MarshalledValue.deserialize(MarshalledValue.java:143) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.marshall.MarshalledValue.get(MarshalledValue.java:224) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.MarshalledValueInterceptor.processRetVal(MarshalledValueInterceptor.java:326) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.MarshalledValueInterceptor.visitGetKeyValueCommand(MarshalledValueInterceptor.java:205) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:189) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.TxInterceptor.visitGetKeyValueCommand(TxInterceptor.java:184) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:130) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:95) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.CacheMgmtInterceptor.visitGetKeyValueCommand(CacheMgmtInterceptor.java:93) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:130) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:95) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.IsMarshallableInterceptor.visitGetKeyValueCommand(IsMarshallableInterceptor.java:94) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:130) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:89) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.commands.AbstractVisitor.visitGetKeyValueCommand(AbstractVisitor.java:95) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.commands.read.GetKeyValueCommand.acceptVisitor(GetKeyValueCommand.java:60) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:345) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.CacheImpl.get(CacheImpl.java:272) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.CacheImpl.get(CacheImpl.java:264) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at org.infinispan.AbstractDelegatingCache.get(AbstractDelegatingCache.java:255) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                  [Server:pd-master-vserver01]           at br.com.buscape.pd.arranger.gateway.impl.AcquirerRoutingServiceImpl.findSuitableAcquirers(AcquirerRoutingServiceImpl.java:191) [pd-arranger-services-api-checkout-1.0.2-SNAPSHOT.jar:]

                  [Server:pd-master-vserver01]           at br.com.buscape.pd.arranger.gateway.impl.AcquirerRoutingServiceImpl.getNextMerchantId(AcquirerRoutingServiceImpl.java:69) [pd-arranger-services-api-checkout-1.0.2-SNAPSHOT.jar:]

                  [Server:pd-master-vserver01]           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) [spring-aop-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) [spring-aop-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) [spring-aop-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) [spring-tx-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) [spring-aop-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at $Proxy127.getNextMerchantId(Unknown Source)          at br.com.buscape.pd.arranger.gateway.impl.TransactionServiceImpl.setAcquirerInfo(TransactionServiceImpl.java:1417) [pd-arranger-services-api-checkout-1.0.2-SNAPSHOT.jar:]

                  [Server:pd-master-vserver01]           at br.com.buscape.pd.arranger.gateway.impl.TransactionServiceImpl.createTransaction(TransactionServiceImpl.java:191) [pd-arranger-services-api-checkout-1.0.2-SNAPSHOT.jar:]

                  [Server:pd-master-vserver01]           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) [spring-aop-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) [spring-aop-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) [spring-aop-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) [spring-tx-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [spring-aop-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) [spring-aop-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at $Proxy135.createTransaction(Unknown Source)          at br.com.buscape.pd.api.checkout.services.rest.TransactionRestResource.create(TransactionRestResource.java:117) [classes:]

                  [Server:pd-master-vserver01]           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_29]

                  [Server:pd-master-vserver01]           at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:176) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:436) [spring-webmvc-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:424) [spring-webmvc-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) [spring-webmvc-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) [spring-webmvc-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669) [spring-webmvc-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:585) [spring-webmvc-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at javax.servlet.http.HttpServlet.service(HttpServlet.java:754) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

                  [Server:pd-master-vserver01]           at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

                  [Server:pd-master-vserver01]           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at br.com.buscape.pd.api.checkout.services.rest.CharacterEncodingShowFilter.doFilterInternal(CharacterEncodingShowFilter.java:74) [classes:]

                  [Server:pd-master-vserver01]           at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:369) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:100) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:78) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:35) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at br.com.buscape.pd.api.checkout.security.ApiAuthenticationFilter.doFilter(ApiAuthenticationFilter.java:105) [classes:]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:381) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:168) [spring-security-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) [spring-web-3.0.6.RELEASE.jar:3.0.6.RELEASE]

                  [Server:pd-master-vserver01]           at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

                  [Server:pd-master-vserver01]           at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

                  [Server:pd-master-vserver01]           at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_29]

                  • 6. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                    Paul Ferraro Master

                    The issue here is that you need to configure Infinispan to use your application classloader.

                    e.g.

                    cache.getAdvancedCache().with(this.getClass().getClassLoader());

                     

                    Once https://issues.jboss.org/browse/ISPN-1367 is implemented (for Infinispan 5.1.3.FINAL), and integrated into the AS (https://issues.jboss.org/browse/AS7-4007), you won't have this problem.

                    • 7. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                      Paul Ferraro Master

                      To clarify, setting the transport "stack" is optional.  If undefined, the default-stack, as defined by the jgroups subsystem, will be used.

                      The "cluster" attribute is also optional.  It defaults to the cache-container name.

                      • 8. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                        Diego Silveira Newbie

                        Thank you Paul,

                         

                        This solved the classloader problem.

                        Now I'm having another problem here, also related to Infinispan.

                         

                        My application uses SpringFramework, and, in order to get the cache-container instance by JNDI lookup I had 3 options to tell JBoss to bind the JNDI, as far as I know:

                         

                        1) Create an EJB that has the CacheContainer injected through @Resource(lookup="jndi.name") in my app.

                        2) Configure the application descriptor (application.xml) in the EAR referencing the resource (CacheContainer)

                        3) Configure cache-container element in domain.xml with attribute start="EAGER"

                         

                        I tried all these options and got different scenarios.

                        - The 1) and 2), leads me to the situation described above, at my first post in this discussion.

                        - The 3) solution was the best until now, because the cache and its replication works appropriately. But when I redeploy my application, I got the following exception, which forces me to restart all JBoss nodes across the cluster to get things working again.

                         

                        -- # --

                        [Server:pd-master-vserver01] Caused by: java.lang.IllegalStateException: Cache 'br.com.buscape.pd.system.gateway.domain.FinancialCategory' is in 'TERMINATED' state and so it does not accept new invocations. Either restart it or recreate the cache container.

                        [Server:pd-master-vserver01]           at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:108) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                        [Server:pd-master-vserver01]           at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:89) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                        [Server:pd-master-vserver01]           at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:61) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                        [Server:pd-master-vserver01]           at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:76) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                        [Server:pd-master-vserver01]           at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:345) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                        [Server:pd-master-vserver01]           at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:944) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                        [Server:pd-master-vserver01]           at org.infinispan.CacheImpl.put(CacheImpl.java:657) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                        [Server:pd-master-vserver01]           at org.infinispan.DecoratedCache.put(DecoratedCache.java:319) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                        [Server:pd-master-vserver01]           at org.infinispan.AbstractDelegatingCache.put(AbstractDelegatingCache.java:259) [infinispan-core-5.1.2.FINAL.jar:5.1.2.FINAL]

                        [Server:pd-master-vserver01]           at org.hibernate.cache.infinispan.util.CacheAdapterImpl.put(CacheAdapterImpl.java:99) [hibernate-infinispan-3.5.6-Final.jar:3.5.6-Final]

                        [Server:pd-master-vserver01]           ... 46 more

                        -- # --

                         

                        It seems that all the entity caches created by Hibernate goes down when the application is undeployed, and Hibernate is not able to recreate them on subsequent deploy.

                         

                        Thank you for all the help!

                        • 9. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                          Paul Ferraro Master

                          Ah - that's sounds like a bug in hibernate-infinispan.

                          The infinispan 2LC cache provider uses EmbeddedCacheManager.getCache(...) to start the cache.  Since the cache manager is shared, it is not stopped when the application is undeployed.  If the cache was previously stopped, this method will not start the cache - but return it in a stopped state. The hibernate-infinispan code should explicitly call Cache.start() before attempting to use the cache.

                          Question, this is a hibernate application (configured via Spring)?  What region factory implementation are you using?  I assume you're using org.hibernate.cache.infinispan.JndiInfinispanRegionFactory?  If so, please try using org.jboss.as.jpa.hibernate3.infinispan.InfinispanRegionFactory.

                          Instead of using JNDI to lookup the cache manager, this region factory looks up the hibernate cache configuration via MSC from the infinispan subsystem.  Since it doesn't rely on JNDI, you don't need to use start="EAGER".  Also, aince this region factory creates a new cache manager per application, you won't run the above issue on redeploy.  The cache container configuraiton used by this region factory is specified via the hibernate.cache.infinispan.container property.  If unspecified, it defaults to the "hibernate" cache container.

                          1 of 1 people found this helpful
                          • 10. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                            Diego Silveira Newbie

                            Yes, that's an hibernate application configured via Spring. An yes, I set org.hibernate.cache.infinispan.JndiInfinispanRegionFactory on "hibernate.cache.region.factory_class" property. I'll try changing this class for org.jboss.as.jpa.hibernate3.infinispan.InfinispanRegionFactory as you suggested. Using this second class, I don't need to set the cache manager JNDI on hibernate.cache.infinispan.cachemanager property, right?

                             

                            I'll test my app with those modifications and let you know the results, ok?

                             

                            Thank you!

                            • 11. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                              Paul Ferraro Master

                              Correct.  org.jboss.as.jpa.hibernate3.infinispan.InfinispanRegionFactory doesn't use JNDI at all.  You will need to specify your cache container name using the hibernate.cache.infinispan.container property, if different from the default.

                              • 12. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                                Diego Silveira Newbie

                                Paul, no luck yet.

                                I tried with the class org.jboss.as.jpa.hibernate3.infinispan.InfinispanRegionFactory but got an CNFE when deploying my app. Also added the "org.jboss.as.jpa.hibernate:3" module dependency in my EAR META-INF/MANIFEST.MF, but still no success.

                                 

                                -- # --

                                [Server:pd-master-vserver01] Caused by: java.lang.ClassNotFoundException: org.jboss.as.jpa.hibernate3.infinispan.InfinispanRegionFactory from [Module "deployment.pd-ear-1.0.2-SNAPSHOT.ear:main" from Service Module Loader]

                                [Server:pd-master-vserver01]           at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)

                                [Server:pd-master-vserver01]           at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)

                                [Server:pd-master-vserver01]           at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)

                                [Server:pd-master-vserver01]           at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)

                                [Server:pd-master-vserver01]           at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)

                                [Server:pd-master-vserver01]           at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)

                                [Server:pd-master-vserver01]           at java.lang.Class.forName0(Native Method) [rt.jar:1.6.0_29]

                                [Server:pd-master-vserver01]           at java.lang.Class.forName(Class.java:169) [rt.jar:1.6.0_29]

                                [Server:pd-master-vserver01]           at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:192) [hibernate-core-3.5.6-Final.jar:3.5.6-Final]

                                [Server:pd-master-vserver01]           at org.hibernate.cfg.SettingsFactory.createRegionFactory(SettingsFactory.java:397) [hibernate-core-3.5.6-Final.jar:3.5.6-Final]

                                [Server:pd-master-vserver01]           ... 45 more

                                -- # --

                                 

                                What am I missing?

                                • 13. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                                  Scott Marlow Master

                                  org.jboss.as.jpa.hibernate3.infinispan.InfinispanRegionFactory should be in the "org.jboss.as.jpa.hibernate:3" module (it in turns depends on org.hibernate.cache.infinispan.InfinispanRegionFactory).  Have you tried a newer Hibernate 3.6.x release (e.g. 3.6.10)? 

                                  • 14. Re: Infinispan, JBoss AS 7.1.1.Final in domain mode: empty cache!
                                    Paul Ferraro Master

                                    In AS7/EAP6 Beta, cache containers are started lazily by default.  This means they are also bound to jndi lazily too.  You can demand a cache container to start in a number of ways:

                                    1. Deploy a distributed application that requires it.  e.g. Deploying a distributable web app will auto-start the web cache container.

                                    2. Lookup the cache container as a JEE resource.  This can be done via the @Resource(lookup="") annotation, or via deployment descriptor.  Examples here:

                                    https://github.com/jbossas/jboss-as/tree/master/testsuite/integration/basic/src/test/java/org/jboss/as/test/integration/ee/injection/resource/infinispan

                                    3. Modify the infinispan subsystem configuration to start the cache container eagerly.  e.g. <cache-container name="rahulscache" start="EAGER"/>

                                     

                                    Given your usage (i.e. plain JNDI lookup), I recommend #3.

                                    1 2 Previous Next