Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-704

Configurator.startProtocolStack() throws NPE if cluster_name is null

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • 2.6.3, 2.7
    • 2.6.2
    • None

      Tries to pass the null to ConcurrentMap.keySet().contains(), which throws NPE:

      2008-02-28 17:43:06,098 ERROR [org.jboss.messaging.util.ExceptionUtil] org.jboss.messaging.core.jmx.MessagingPostOfficeService@1a0d916 startService
      org.jgroups.ChannelException: failed to start protocol stack
      at org.jgroups.JChannel.startStack(JChannel.java:1440)
      at org.jgroups.JChannel.connect(JChannel.java:362)
      at org.jboss.messaging.core.impl.postoffice.GroupMember.start(GroupMember.java:142)
      ....
      Caused by: java.lang.NullPointerException
      at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:157)
      at java.util.concurrent.ConcurrentHashMap.containsKey(ConcurrentHashMap.java:745)
      at java.util.concurrent.ConcurrentHashMap$KeySet.contains(ConcurrentHashMap.java:1215)
      at org.jgroups.stack.Configurator.startProtocolStack(Configurator.java:85)
      at org.jgroups.stack.ProtocolStack.startStack(ProtocolStack.java:341)
      at org.jgroups.JChannel.startStack(JChannel.java:1437)
      ... 59 more

      In JChannel.startStack(String cluster_name) there's this which implies a null cluster_name is meant to work:

      if(cluster_name == null) {
      if(log.isDebugEnabled()) log.debug("cluster_name is null, assuming unicast channel");
      }

      If it isn't meant to work any longer, then an IllegalArgumentException is better than NPE.

              rhn-engineering-bban Bela Ban
              bstansbe@redhat.com Brian Stansberry
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: