1 2 Previous Next 15 Replies Latest reply on Nov 14, 2017 8:43 AM by Anup D

    Infinispan : cache not found on node 2 issue

    Anup D Newbie

      Hi,

       

      We have set up 2 wildfly instances in a cluster - node 1 and node 2 ( both are able to see each other )

       

      A replicated-cache is defined on node 1. The definition is shown below.

       

      <cache-container name="InfinispanContainer" default-cache="infinispan-cache" jndi-name="java:jboss/infinispan/Infinispan">
                      <transport lock-timeout="60000"/>
                      <replicated-cache name="if-cache" mode="ASYNC"/>
      </cache-container>
      

      node 2 does not have the above cache defined.

      nodes are started in the order - node 1 first and node 2 second. Both form cluster.

       

      An application is deployed on node 1 to access the above cache and write,read data from it. Code snippet is shown below ( singleton EJB)

       

      @Singleton
      @Startup
      @ConcurrencyManagement
      public class InfinispanCacheManager {
      
      //@Resource(lookup="java:jboss/infinispan/Infinispan")
      //CacheContainer cacheContainer;
      
      public InfinispanCacheManager() {
      System.out.println("constructing IC manager");
      }
      
      @PostConstruct
      public void init() {
                 Context ctx = null;
                CacheContainer cacheContainer = null;
      try {
           ctx = new InitialContext();
           cacheContainer = (CacheContainer)ctx.lookup("java:jboss/infinispan/Infinispan");
      } catch(Exception e) {
           e.printStackTrace();
      }
      if(cacheContainer != null) {
           System.out.println("cache is initialized "+cacheContainer.DEFAULT_CACHE_NAME);
           Cache<String,String> cache = cacheContainer.getCache("if-cache");
           cache.put("Key","HereIsTheValueForKey");
           System.out.println("value for Key "+cache.get("Key"));
      } else {
           System.out.println("cache is not initialized "+cacheContainer);
      }
      
      }
      

       

      Now, when we restart node 1, the application tries to get deployed but fails at below line.

       

      Cache<String,String> cache = cacheContainer.getCache("if-cache");

       

       

      2017-11-08 18:52:16,444 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 72) MSC000001: Failed to start service jboss.deployment.unit."InfinispanCache-0.0.1-SNAPSHOT.jar".component.InfinispanCacheManager.START: org.jboss.msc.service.StartException in service jboss.deployment.unit."InfinispanCache-0.0.1-SNAPSHOT.jar".component.InfinispanCacheManager.START: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
              at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:57)
              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
              at java.util.concurrent.FutureTask.run(FutureTask.java:266)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
              at org.jboss.threads.JBossThread.run(JBossThread.java:320)
      Caused by: java.lang.IllegalStateException: WFLYEE0042: Failed to construct component instance
              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:163)
              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:134)
              at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:88)
              at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:124)
              at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:138)
              at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)
              ... 6 more
      
      Caused by: javax.ejb.EJBException: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.start() throws java.lang.Exception on object of type StateTransferManagerImpl
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187)
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:277)
              at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:349)
              at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:68)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
              at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
              at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
              at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
              at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
              at org.jboss.as.ejb3.component.singleton.StartupCountDownInterceptor.processInvocation(StartupCountDownInterceptor.java:25)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
              at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
              at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
              at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
              at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
              at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:161)
              ... 11 more
      Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.start() throws java.lang.Exception on object of type StateTransferManagerImpl
              at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:172)
              at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:859)
              at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:628)
              at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:617)
              at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:542)
              at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:238)
              at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:849)
              at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:635)
              at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:585)
              at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:451)
      Caused by: org.infinispan.remoting.transport.jgroups.SuspectException: Cache not running on node node 2
              at org.infinispan.remoting.transport.AbstractTransport.checkResponse(AbstractTransport.java:46)
              at org.infinispan.remoting.transport.jgroups.JGroupsTransport.checkRsp(JGroupsTransport.java:795)
              at org.infinispan.remoting.transport.jgroups.JGroupsTransport.lambda$invokeRemotelyAsync$0(JGroupsTransport.java:629)
              at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
              at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
              at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
              at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
              at org.infinispan.remoting.transport.jgroups.SingleResponseFuture.futureDone(SingleResponseFuture.java:30)
              at org.jgroups.blocks.Request.checkCompletion(Request.java:152)
              at org.jgroups.blocks.UnicastRequest.receiveResponse(UnicastRequest.java:70)
              at org.jgroups.blocks.RequestCorrelator.dispatch(RequestCorrelator.java:427)
              at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:357)
              at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:245)
              at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:664)
              at org.jgroups.JChannel.up(JChannel.java:738)
              at org.jgroups.fork.ForkProtocolStack.up(ForkProtocolStack.java:120)
              at org.jgroups.stack.Protocol.up(Protocol.java:380)
              at org.jgroups.protocols.FORK.up(FORK.java:114)
              at org.jgroups.protocols.FRAG2.up(FRAG2.java:165)
              at org.jgroups.protocols.FlowControl.up(FlowControl.java:390)
              at org.jgroups.protocols.FlowControl.up(FlowControl.java:374)
              at org.jgroups.protocols.pbcast.GMS.up(GMS.java:1040)
              at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)
              at org.jgroups.protocols.UNICAST3.deliverMessage(UNICAST3.java:1070)
              at org.jgroups.protocols.UNICAST3.handleDataReceived(UNICAST3.java:785)
              at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:426)
              at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:649)
              at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:155)
              at org.jgroups.protocols.FD_ALL.up(FD_ALL.java:200)
              at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:310)
      

       

      It is not mandatory to run the cache on node 2 as well. Isn't it ? Can you please let me know if this is fixed.

      Wildfly - wildfly-10.1.0.Final

      Infinispan - infinispan-core-8.2.4.Final.jar

       

      Thanks

        • 1. Re: Infinispan : cache not found on node 2 issue
          Paul Ferraro Master

          A couple of observations:

          1. Your configuration does not look valid.  Your cache-container uses default-cache="infinispan-cache", but does not define such a cache.
          2. This is not the proper way to access a server managed cache from within your @Singleton EJB.  Instead use the following:

           

          @Singleton  
          @Startup  
          @ConcurrencyManagement  
          public class InfinispanCacheManager {  
            
              @Resource(lookup="java:jboss/infinispan/cache/if-cache")  
              Cache<?, ?> cache;
          }
          

           

          If your EJB uses CDI annotations, the @Resource handling won't work correctly (due to a known bug).  In this case, use a <resource-ref/> in your deployment descriptor with the same <lookup-name/>, and use the res-ref-name in your @Resource annotation.

          • 2. Re: Infinispan : cache not found on node 2 issue
            Anup D Newbie

            Hi Paul,

            Thanks for taking a look. I modified as per your observations as shown below

             

            1. Defined the missing default-cache as shown below

            <cache-container name="InfinispanContainer" default-cache="infinispan-cache" jndi-name="java:jboss/infinispan/cache">
                            <transport lock-timeout="60000"/>
                            <local-cache name="infinispan-cache">
                                <eviction strategy="LRU" max-entries="10000"/>
                                <expiration max-idle="100000"/>
                            </local-cache>
                            <replicated-cache name="if-cache" jndi-name="java:jboss/infinispan/cache/if-cache" mode="ASYNC"/>
                        </cache-container>
            

             

            2. Modified EJB to use resource-ref in jboss-ejb3.xml

            <?xml version="1.0"?> 
              <jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
                              xmlns="http://java.sun.com/xml/ns/javaee"
                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                              xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
                                http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd"
                              version="3.1"
                              impl-version="2.0">
                <enterprise-beans>       
                  <session>
                        <ejb-name>InfinispanCacheManager</ejb-name>
                        <ejb-class>com.test.infinispan.InfinispanCacheManager</ejb-class>           
                        <resource-ref>
                            <res-ref-name>ReplicatedCache</res-ref-name>
                            <jndi-name>java:jboss/infinispan/cache/if-cache</jndi-name>
                        </resource-ref>
                    </session>     
                </enterprise-beans>
            </jboss:ejb-jar>
            
            
            package com.test.infinispan;
            import javax.annotation.PostConstruct;
            import javax.annotation.PreDestroy;
            import javax.annotation.Resource;
            import javax.ejb.ConcurrencyManagement;
            import javax.ejb.Singleton;
            import javax.ejb.Startup;
            import org.infinispan.Cache;
            
            @Singleton
            @Startup
            @ConcurrencyManagement
            public class InfinispanCacheManager {
            
            @Resource(name="ReplicatedCache")
            Cache<String,String> cache;
            
            public InfinispanCacheManager() {
            System.out.println("constructing IC manager");
            }
            
            @PostConstruct
            public void init() {
            cache.put("Key","HereIsTheValueForKey");
            System.out.println("value for Key "+cache.get("Key"));
            }
            
            @PreDestroy
            public void destroy() {
            }
            }
            

             

            Test Case :

             

            1. Defined cache, started wildfly and deployed above application on node 1. Works fine. EJB prints intended log messages shown in code above

             

                      2017-11-11 12:34:34,437 INFO  [stdout] (ServerService Thread Pool -- 77) constructing IC manager
                      2017-11-11 12:34:34,479 INFO  [stdout] (ServerService Thread Pool -- 77) value for Key HereIsTheValueForKey
            

             

            2. Started another instance of wildfly on node 2. This does not have neither cache nor application. It forms cluster with node 1.

            3. Restarted node 1. Then, the application hangs at Resource injection point for 4 to 5 minutes and then throws below exception.

             

            2017-11-11 12:40:49,561 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 76) MSC000001: Failed to start service jboss.infinispan.InfinispanContainer.if-cache: org.jboss.msc.service.StartException in service jboss.infinispan.InfinispanContainer.if-cache: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.start() throws java.lang.Exception on object of type StateTransferManagerImpl
                    at org.wildfly.clustering.service.AsynchronousServiceBuilder$1.run(AsynchronousServiceBuilder.java:107)
                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
                    at java.lang.Thread.run(Thread.java:745)
                    at org.jboss.threads.JBossThread.run(JBossThread.java:320)
            Caused by: org.infinispan.commons.CacheException: Unable to invoke method public void org.infinispan.statetransfer.StateTransferManagerImpl.start() throws java.lang.Exception on object of type StateTransferManagerImpl
                    at org.infinispan.commons.util.ReflectionUtil.invokeAccessibly(ReflectionUtil.java:172)
                    at org.infinispan.factories.AbstractComponentRegistry$PrioritizedMethod.invoke(AbstractComponentRegistry.java:859)
                    at org.infinispan.factories.AbstractComponentRegistry.invokeStartMethods(AbstractComponentRegistry.java:628)
                    at org.infinispan.factories.AbstractComponentRegistry.internalStart(AbstractComponentRegistry.java:617)
                    at org.infinispan.factories.AbstractComponentRegistry.start(AbstractComponentRegistry.java:542)
                    at org.infinispan.factories.ComponentRegistry.start(ComponentRegistry.java:238)
                    at org.infinispan.cache.impl.CacheImpl.start(CacheImpl.java:849)
                    at org.infinispan.manager.DefaultCacheManager.wireAndStartCache(DefaultCacheManager.java:635)
                    at org.infinispan.manager.DefaultCacheManager.createCache(DefaultCacheManager.java:585)
                    at org.infinispan.manager.DefaultCacheManager.getCache(DefaultCacheManager.java:451)
                    at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:117)
                    at org.jboss.as.clustering.infinispan.DefaultCacheContainer.getCache(DefaultCacheContainer.java:112)
                    at org.wildfly.clustering.infinispan.spi.service.CacheBuilder.start(CacheBuilder.java:80)
                    at org.wildfly.clustering.service.AsynchronousServiceBuilder$1.run(AsynchronousServiceBuilder.java:102)
                    ... 4 more
            Caused by: org.infinispan.remoting.transport.jgroups.SuspectException: Cache not running on node node 2
                    at org.infinispan.remoting.transport.AbstractTransport.checkResponse(AbstractTransport.java:46)
                    at org.infinispan.remoting.transport.jgroups.JGroupsTransport.checkRsp(JGroupsTransport.java:795)
                    at org.infinispan.remoting.transport.jgroups.JGroupsTransport.lambda$invokeRemotelyAsync$0(JGroupsTransport.java:629)
                    at java.util.concurrent.CompletableFuture.uniApply(CompletableFuture.java:602)
                    at java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:577)
                    at java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:474)
                    at java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:1962)
                    at org.infinispan.remoting.transport.jgroups.SingleResponseFuture.futureDone(SingleResponseFuture.java:30)
                    at org.jgroups.blocks.Request.checkCompletion(Request.java:152)
                    at org.jgroups.blocks.UnicastRequest.receiveResponse(UnicastRequest.java:70)
                    at org.jgroups.blocks.RequestCorrelator.dispatch(RequestCorrelator.java:427)
                    at org.jgroups.blocks.RequestCorrelator.receiveMessage(RequestCorrelator.java:357)
                    at org.jgroups.blocks.RequestCorrelator.receive(RequestCorrelator.java:245)
                    at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:664)
                    at org.jgroups.JChannel.up(JChannel.java:738)
                    at org.jgroups.fork.ForkProtocolStack.up(ForkProtocolStack.java:120)
                    at org.jgroups.stack.Protocol.up(Protocol.java:380)
                    at org.jgroups.protocols.FORK.up(FORK.java:114)
                    at org.jgroups.protocols.FRAG2.up(FRAG2.java:165)
                    at org.jgroups.protocols.FlowControl.up(FlowControl.java:390)
                    at org.jgroups.protocols.FlowControl.up(FlowControl.java:374)
                    at org.jgroups.protocols.pbcast.GMS.up(GMS.java:1040)
                    at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:234)
                    at org.jgroups.protocols.UNICAST3.deliverMessage(UNICAST3.java:1070)
                    at org.jgroups.protocols.UNICAST3.handleDataReceived(UNICAST3.java:785)
                    at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:426)
                    at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:649)
                    at org.jgroups.protocols.VERIFY_SUSPECT.up(VERIFY_SUSPECT.java:155)
                    at org.jgroups.protocols.FD_ALL.up(FD_ALL.java:200)
                    at org.jgroups.protocols.FD_SOCK.up(FD_SOCK.java:310)
            

             

            Thanks

            • 3. Re: Infinispan : cache not found on node 2 issue
              Paul Ferraro Master

              Which version of WildFly is this?  If not the latest, can you reproduce the problem with the 11.0.0.Final?

              • 4. Re: Infinispan : cache not found on node 2 issue
                Paul Ferraro Master

                Also, how are you exposing the Infinispan APIs to your application?  You should not bundle any jars, but instead expose the server's org.infinispan module to your application.

                e.g. META-INF/MANIFEST.MF

                Dependencies: org.infinispan
                
                • 5. Re: Infinispan : cache not found on node 2 issue
                  Anup D Newbie

                  1. Version details are below :

                            Wildfly - wildfly-10.1.0.Final

                            Infinispan - infinispan-core-8.2.4.Final.jar

                  2. Wildfly 11 has infinispan 8.2.8 version. So, I am not sure if it would be fixed in that ( as it is a minor upgrade ).

                  3. We have not bundled and installed infinispan as a seperate one. We are using the wildfly server provided org.infinispan module.

                  4. The dependency is exposed to application through one of wildfly recommended jboss-deployment-structure.xml ( kept inside META-INF )

                  <?xml version="1.0" encoding="UTF-8"?>
                  <jboss-deployment-structure>
                  <deployment>
                  <dependencies>
                  <module name="org.infinispan" />
                  </dependencies>
                  </deployment>
                  </jboss-deployment-structure> 
                  
                  • 6. Re: Infinispan : cache not found on node 2 issue
                    Anup D Newbie

                    It was possible to reproduce the issue on wildlfy-11.0.0.Final.

                    1. Downloaded and set up a cluster of 2 wildfly instances.

                    2. Replicated Cache is defined on node 1 only. Both were booted using standalone-full-ha.xml. Both start fine.

                    3. Deployed application on node 1. works fine.

                    4. Restart node 1 wildfly. The same set of exceptional behaviour occur as previously reported.

                     

                    I have attached the server logs of both the server. Just node 1 and node 2 names are different

                    • 7. Re: Infinispan : cache not found on node 2 issue
                      Paul Ferraro Master

                      Do you still have this problem if you switch the cache mode to SYNC?  I would strongly discourage you from using ASYNC mode anyway.  This will be deprecated in WF12.  Cache operations can be made async using Infinispan's async api:

                      infinispan/AsyncCache.java at 8.2.x · infinispan/infinispan · GitHub

                      • 8. Re: Infinispan : cache not found on node 2 issue
                        Anup D Newbie

                        I just re-tested by changing cache mode to SYNC and the issue still exists.

                        <replicated-cache name="if-cache" jndi-name="java:jboss/infinispan/cache/if-cache" mode="SYNC"/>

                         

                        Earlier, we did not face this issue in FSW which had EAP 6.x.

                        This one is having a critical impact on our migration to wildfly.

                        Could you please analyze and port fixes on atleast wildfly 10.x onwards.

                        Let me know if you need any other tests to be run.

                        • 9. Re: Infinispan : cache not found on node 2 issue
                          Anup D Newbie

                          Paul,

                          Kindly advise what approach can be taken to solve this problem.

                          Would filing a bug report help so that other developers who might have time can work on it ?

                          • 10. Re: Infinispan : cache not found on node 2 issue
                            Paul Ferraro Master

                            OK - I was able to reproduce this locally.  The underlying issue is a conflict between ActiveMQ Artemis and Infinispan trying to use the same JGroups channel.

                            Normally, this works fine, however, in your sequence of events, the coordinator of the JGroups cluster does not have any caches started, yet it is trying to coordinate the transfer of state on behalf of caches it knows nothing about.

                             

                            There are few things you can do about this:

                            1. If you don't need ActiveMQ discovery, disable it.  This will prevent it from starting a JGroups channel and avoids the conflict.

                            e.g.

                            <subsystem xmlns="urn:jboss:domain:messaging-activemq:2.0">
                                <server name="default">
                                    <!-- ... -->
                                    <!--broadcast-group name="bg-group1" jgroups-channel="activemq-cluster" connectors="http-connector"/-->
                                    <!--discovery-group name="dg-group1" jgroups-channel="activemq-cluster"/-->
                                    <!-- ... -->
                                </server>
                            </subsystem>
                            

                             

                            2. If you need ActiveMQ discovery, configure it to use a distinct JGroups channel (i.e. not the default channel).  Each channel will have a distinct group membership and similarly avoids any conflict.

                            e.g.

                            <subsystem xmlns="urn:jboss:domain:jgroups:5.0">
                                <channels default="ee">
                                    <channel name="ee" stack="udp"/>
                                    <channel name="other" stack="tcp"/>
                                </channels>
                                <!-- ... -->
                            </subsystem>
                            
                            <subsystem xmlns="urn:jboss:domain:messaging-activemq:2.0">
                                <server name="default">
                                    <!-- ... -->
                                    <broadcast-group name="bg-group1" jgroups-stack="other" jgroups-channel="activemq-cluster" connectors="http-connector"/>
                                    <discovery-group name="dg-group1" jgroups-stack="other" jgroups-channel="activemq-cluster"/>
                                    <!-- ... -->
                                </server>
                            </subsystem>
                            

                            Yes - those broadcast/discovery-group attribute names are confusing.  This is a known issue: [WFLY-5459] Rename JGroups-related attributes - JBoss Issue Tracker

                             

                            3. Alternatively, instead of changing ActiveMQ, you can change your Infinispan transport to use a distinct JGroups channel.

                            e.g.

                            <subsystem xmlns="urn:jboss:domain:infinispan:4.0">
                                <cache-container name="InfinispanContainer" default-cache="if-cache">
                                    <transport channel="other"/>
                                    <replicated-cache name="if-cache" mode="SYNC"/>
                                </cache-container>
                            </subsystem>
                            
                            • 11. Re: Infinispan : cache not found on node 2 issue
                              Anup D Newbie

                              Paul,

                               

                              Thanks. I applied the configuration change suggested by you on wildfly 11. It seems to be working fine.

                              However, this is not working on wildfly-10.1.0.Final.

                               

                              Is it possible to port the fix from 11 to 10 ? Atleast, If I can know in which files the fix have been made, we can try to build those jars and use it on 10.

                               

                              Thanks

                              Anup

                              • 12. Re: Infinispan : cache not found on node 2 issue
                                Paul Ferraro Master

                                Yes - it should be portable to WF 10.1.  You probably just need to adjust the schema versions to match the latest for that version.  if it's more than that, please paste any exceptions you see.

                                • 13. Re: Infinispan : cache not found on node 2 issue
                                  Anup D Newbie

                                  Thanks. I upgraded to below jars coming from 11 on 10. And, it seems to work fine.

                                       infinispan-core-8.2.8.Final.jar

                                       infinispan-cachestore-remote-8.2.8.Final.jar

                                       infinispan-cachestore-jdbc-8.2.8.Final.jar

                                       infinispan-client-hotrod-8.2.8.Final.jar

                                       infinispan-commons-8.2.8.Final.jar

                                   

                                  Also, I upgraded to jgroups-3.6.13.Final.jar as infinispan depends on that.

                                  Could you please confirm if

                                       a. above jars are sufficent ? In case any more needed, please specify.

                                       b. and upgrade of the above does not cause any side effects/issues ?

                                   

                                   

                                   

                                  • 14. Re: Infinispan : cache not found on node 2 issue
                                    Paul Ferraro Master

                                    I don't foresee any issues running with these library versions on WF 10.1.

                                    1 2 Previous Next