[jboss-user] [JBossCache] - ClusteredCache fails with Region activation/inactivation

jorgemoralespou_2 do-not-reply at jboss.com
Tue Apr 24 12:41:46 EDT 2007


Hi, I have a 2 node cache, and I use ClusterCacheLoader (JBossCache 1.4.1.SP3). I set inactiveOnStartup to true on startup of the AS, and as I deploy applications taht uses the cache, I activate the regions it uses programatically.
Problem is that when I deploy an app, in node one, it works perfectly. Then I deploy/start application in node 2, an exception is thrown.

  | java.lang.NullPointerException
  |  at org.jboss.cache.loader.ClusteredCacheLoader.callRemote(ClusteredCacheLoader.java:98)
  |  at org.jboss.cache.loader.ClusteredCacheLoader.getChildrenNames(ClusteredCacheLoader.java:66)
  |  at org.jboss.cache.loader.AsyncCacheLoader.getChildrenNames(AsyncCacheLoader.java:157)
  | 

I downloaded the source code, and fixed my problem by doing this:
replaced (in ClusteredCacheLoader):

  | if (((Boolean) clusteredGetResp.get(0)).booleanValue())
  | 

with:

  | Boolean resp = (Boolean) ((clusteredGetResp!=null && clusteredGetResp.size()>0)? clusteredGetResp.get(0):null);
  | if (resp !=null && resp.booleanValue())
  | 
                    
Also, I have seen this is not aplicable to 2.0 branch, as it uses Java 5 features.

I don`t know if this is a bug, or I`m doing something wrong. Probably you can evaluate it better than I.

Another question is in documentation it states that whenever you want to use region activation/inactivation with cacheloader, the cacheloader should implement ExtendedCacheLoader, which ClusteredCacheLoader does not. 

Thanks



View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4040258#4040258

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4040258



More information about the jboss-user mailing list