NPE in RaftActor#onGetOnDemandRaftStats 54/18854/4
authorTom Pantelis <>
Wed, 22 Apr 2015 06:09:15 +0000 (02:09 -0400)
committerTom Pantelis <>
Thu, 23 Apr 2015 11:22:59 +0000 (07:22 -0400)
I had a 3 node setup with 1 node down and when I tried to access the
shard info via JConsole I saw this exception :

java.lang.NullPointerException: null value in entry:

The peer address in the map for the down node was null which
ImmutableMap.copyOf doesn't like. I changed it to HashMap.

Change-Id: If9e0dfb3f7f213c11c99d98a5fd9c804c0876776
Signed-off-by: Tom Pantelis <>

index 4485f3b..1738cc5 100644 (file)
@@ -16,10 +16,10 @@ import akka.persistence.SnapshotSelectionCriteria;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.TimeUnit;
@@ -259,7 +259,7 @@ public abstract class RaftActor extends AbstractUntypedPersistentActor {
-                .peerAddresses(ImmutableMap.copyOf(context.getPeerAddresses()));
+                .peerAddresses(new HashMap<>(context.getPeerAddresses()));
         ReplicatedLogEntry lastLogEntry = getLastLogEntry();
         if (lastLogEntry != null) {

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.