5 Replies Latest reply: Mar 14, 2013 6:47 AM by Daniel C RSS

    Issue when executing Processors in node with local storage disabled

    Daniel C
      Hi everybody,

      We are testing Coherence JSR107 (a.k.a. JCache) implementation from Yannis (https://github.com/yannis666/Coherence-JSR-107) and we have found following issue when working with a distributed cache node where local storage is disabled (using -Dtangosol.coherence.distributed.localstorage=false). Yannis implementation uses several EntryProcessors for executing get() or put() operations in cache. For example, following code is used for putting a value in cache:

      public class PutProcessor implements InvocableMap.EntryProcessor {

      @Override
      public Object process(InvocableMap.Entry entry) {
      BinaryEntry bEntry = (BinaryEntry) entry;
      return bEntry.isPresent() ? bEntry.getBinaryValue() : null;
      }

      }

      And put operatino is fired from following code:

      namedCache.invoke(key, processor)

      where processor argument contains a reference to PutProcessor object.


      When we call JSR107 put operation in cache and above code executes we get following exception:

      java.lang.NullPointerException
           at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.invoke(PartitionedCache.CDB:10)
           at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onInvokeRequest(PartitionedCache.CDB:52)
           at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$InvokeRequest.run(PartitionedCache.CDB:1)
           at com.tangosol.coherence.component.net.message.requestMessage.DistributedCacheKeyRequest.onReceived(DistributedCacheKeyRequest.CDB:12)
           at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onMessage(Grid.CDB:34)
           at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:33)
           at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.PartitionedService.onNotify(PartitionedService.CDB:3)
           at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onNotify(PartitionedCache.CDB:3)
           at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
           at java.lang.Thread.run(Thread.java:662)

      Of course we previously started another node in cluster with local storage enabled.

      It seems that as no backing map is present at node, a NullPointerException is thrown when trying to insert the entry.

      Could anyone give us advice on this issue and how to overcome it? Is this implementation based on Processor not compatible with localstorage disabled cache nodes?

      Thank you in advance,

      Daniel C.