0

I am new to infinispan and I am trying clustered configuration. Here is my code

GlobalConfigurationBuilder globalConfig = GlobalConfigurationBuilder.defaultClusteredBuilder();
globalConfig.transport().clusterName("infiniDistributedCluster").distributedSyncTimeout(30000).globalJmxStatistics().enable().allowDuplicateDomains(Boolean.TRUE);
configBuilder = new org.infinispan.configuration.cache.ConfigurationBuilder();
embeddedCacheManager = new DefaultCacheManager(globalConfig.build());
configBuilder.dataContainer().compatibility().enable().clustering().cacheMode(CacheMode.DIST_SYNC).sync().hash().numOwners(2).l1().lifespan(60000);
embeddedCacheManager.defineConfiguration("TestCache", configBuilder.build());

HotRodServerConfiguration build = new HotRodServerConfigurationBuilder().host(hotRodIpAddress).build();
HotRodServer server = new HotRodServer();
server.start(build, embeddedCacheManager);

I am trying to fetch it from my HotRod client.

ConfigurationBuilder remoteBuilder = new ConfigurationBuilder();
remoteBuilder.addServers(serverIP).nearCache().mode(NearCacheMode.LAZY).maxEntries(500);
RemoteCacheManager remoteCacheManager = new RemoteCacheManager(remoteBuilder.build());
remoteCache = remoteCacheManager.getCache("TestCache");

But I receive the above exception.

J. P
  • 356
  • 4
  • 20
  • What Infinispan version? Any chance of showing the line where the NPE is thrown? The Hot Rod client code is tested creating a local Hot Rod server in similar way to what you're doing but dunno what might be different – Galder Zamarreño Oct 30 '17 at 09:09
  • It's 7.1.1 As far as I remember I did first get, then put & then again get & I land up this exception – J. P Nov 01 '17 at 11:12
  • Can you try with a more recent version? Latest stable is 9.1.2 – Galder Zamarreño Nov 01 '17 at 16:25
  • I am abide to use 7.1.1 in this product – J. P Nov 07 '17 at 14:40
  • Right, I understand that you have to stick to that version, but if you try latest stable, we can see if the issue is still present. If the issue still present, we can work to fix it. If the issue is not present in latest stable, you can debug through the code to see how it works in recent versions and compare with the version you're stuck with ;) – Galder Zamarreño Nov 14 '17 at 09:20
  • You could also try to enable TRACE logging, get a full stacktrace (what variable is null? Check the Infinispan JIRA to see if the same stacktrace lines appear somewhere...etc. If you can't move to the latest version, you're going to need to do some digging... – Galder Zamarreño Nov 14 '17 at 09:22

0 Answers0