1 Reply Latest reply on Jan 19, 2010 5:20 AM by Ulrich Staudinger

    Pojo Cache Cluster problem

    Craig Simpson Newbie

      I'm probably missing something easy here, but I'm trying to get PojoCache working in a clustered JBoss setup. I'm using JBoss AS 4.2.3 and JBoss Cache 1.4.1. I've used the following web site as a template for the conf files:

      http://www.samaxes.com/2009/03/jboss-pojocache-configuration/

      Everything seems to start up fine. The first server in the cluster starts and this shows up in the console window (from log output):

      INFO [POJOCacheMgr] Initializing Pojo Cache
      INFO [POJOCacheMgr] putObject at /1/obj1; type: com.test.Data.TestCacheData
      INFO [POJOCacheMgr] putObject at /1/obj2; type: com.test.Data.TestCacheData
      INFO [POJOCacheMgr] putObject at /1/obj3; type: com.test.Data.TestCacheData

      The second computer joins the cluster:

      15:16:22,908 INFO [TreeCache] viewAccepted(): [10.48.12.136:2075|1] [10.48.12.136:2075, 10.48.11.160:3647]
      15:16:23,126 INFO [TreeCache] locking the subtree at / to transfer state
      15:16:23,142 INFO [StateTransferGenerator_140] returning the state for tree rooted in /(1024 bytes)
      15:16:29,673 INFO [MyPartition] New cluster view for partition MyPartition (id: 1, delta: 1) : [10.48.12.136:1099, 10.48.11.160:1099]
      15:16:29,673 INFO [MyPartition] I am (10.48.12.136:1099) received membershipChanged event:
      15:16:29,673 INFO [MyPartition] Dead members: 0 ([])
      15:16:29,673 INFO [MyPartition] New Members : 1 ([10.48.11.160:1099])
      15:16:29,673 INFO [MyPartition] All Members : 2 ([10.48.12.136:1099, 10.48.11.160:1099])
      15:16:32,595 INFO [TreeCache] viewAccepted(): [10.48.12.136:2084|1] [10.48.12.136:2084, 10.48.11.160:3659]
      15:16:34,908 INFO [TreeCache] viewAccepted(): [10.48.12.136:2088|1] [10.48.12.136:2088, 10.48.11.160:3664]
      15:16:43,126 INFO [TreeCache] viewAccepted(): [10.48.12.136:2093|1] [10.48.12.136:2093, 10.48.11.160:3670]
      15:35:53,923 INFO [MyPartition] Suspected member: 10.48.11.160:3653
      15:35:53,970 INFO [TreeCache] viewAccepted(): [10.48.12.136:2088|2] [10.48.12.136:2088]
      15:35:53,970 INFO [MyPartition] New cluster view for partition MyPartition (id: 2, delta: -1) : [10.48.12.136:1099]
      15:35:53,970 INFO [myPartition] I am (10.48.12.136:1099) received membershipChanged event:
      15:35:53,970 INFO [MyPartition] Dead members: 1 ([10.48.11.160:1099])
      15:35:53,970 INFO [MyPartition] New Members : 0 ([])
      15:35:53,970 INFO [MyPartition] All Members : 1 ([10.48.12.136:1099])
      15:35:53,986 INFO [TreeCache] viewAccepted(): [10.48.12.136:2093|2] [10.48.12.136:2093]
      15:35:54,033 INFO [TreeCache] viewAccepted(): [10.48.12.136:2084|2] [10.48.12.136:2084]
      15:35:54,033 INFO [TreeCache] viewAccepted(): [10.48.12.136:2075|2] [10.48.12.136:2075]
      15:36:03,314 INFO [TreeCache] viewAccepted(): [10.48.12.136:2075|3] [10.48.12.136:2075, 10.48.11.160:3815]
      15:36:03,470 INFO [TreeCache] locking the subtree at / to transfer state
      15:36:03,470 INFO [StateTransferGenerator_140] returning the state for tree rooted in /(1024 bytes)
      15:36:09,064 INFO [MyPartition] New cluster view for partition MyPartition (id: 3, delta: 1) : [10.48.12.136:1099, 10.48.11.160:1099]
      15:36:09,064 INFO [MyPartition] I am (10.48.12.136:1099) received membershipChanged event:
      15:36:09,064 INFO [MyPartition] Dead members: 0 ([])
      15:36:09,064 INFO [MyPartition] New Members : 1 ([10.48.11.160:1099])
      15:36:09,064 INFO [MyPartition] All Members : 2 ([10.48.12.136:1099, 10.48.11.160:1099])
      15:36:11,783 INFO [TreeCache] viewAccepted(): [10.48.12.136:2084|3] [10.48.12.136:2084, 10.48.11.160:3827]
      15:36:14,095 INFO [TreeCache] viewAccepted(): [10.48.12.136:2088|3] [10.48.12.136:2088, 10.48.11.160:3832]
      15:36:21,408 INFO [TreeCache] viewAccepted(): [10.48.12.136:2093|3] [10.48.12.136:2093, 10.48.11.160:3838]

      The first computer can view the objects in the cache with no problems, however the second computer never finds it.
      I always get a null when I try to retrieve the data.

      Here is the code that gets called to init the cache

      private PojoCacheMBean PojoCache;
      
      public void initCache(final String name) throws Exception {
      
       log.info("Initializing POJO Cache");
       try {
      
       //server = MBeanServerLocator.locateJBoss();
       server = MBeanServerLocator.locate();
      
       PojoCache = (PojoCacheMBean)MBeanProxyExt.create(PojoCacheMBean.class,
      name,server);
      
       if (PojoCache == null) {
       throw new Exception("Could not create clientCache (PojoCache)");
       }
       }
      
       catch (Exception e) {
       throw new Exception("Could not init clientCache (PojoCache)",e);
       }
      }
      


      I'm not sure what I'm doing wrong

      Thanks in advance.