shoal
  1. shoal
  2. SHOAL-67

NPE seen in ClusterManager Line 161 while executing Shoal Sample

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: GMS
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      67

      Description

      Multiple users have pointed out this NPE. Cause is known and a fix is ready to
      be checked in.
      Thanks to David Taylor for the following stack trace :
      init:
      deps-jar:
      compile:
      run:
      Jun 27, 2008 2:59:38 PM SimpleGMSSample runSimpleSample
      INFO: Starting SimpleGMSSample....
      Jun 27, 2008 2:59:38 PM SimpleGMSSample initializeGMS
      INFO: Initializing Shoal for member: server1214603978093 group:Group1
      Jun 27, 2008 2:59:38 PM SimpleGMSSample registerForGroupEvents
      INFO: Registering for group event notifications
      Jun 27, 2008 2:59:38 PM SimpleGMSSample joinGMSGroup
      INFO: Joining Group Group1
      Exception in thread "main" java.lang.NullPointerException
      at
      com.sun.enterprise.jxtamgmt.ClusterManager.<init>(ClusterManager.java:162)
      at
      com.sun.enterprise.ee.cms.impl.jxta.GroupCommunicationProviderImpl.initializ
      eGroupCommunicationProvider(GroupCommunicationProviderImpl.java:138)
      at
      com.sun.enterprise.ee.cms.impl.jxta.GMSContext.join(GMSContext.java:122)
      at
      com.sun.enterprise.ee.cms.impl.common.GroupManagementServiceImpl.join(GroupM
      anagementServiceImpl.java:331)
      at SimpleGMSSample.joinGMSGroup(SimpleGMSSample.java:76)
      at SimpleGMSSample.runSimpleSample(SimpleGMSSample.java:46)
      at SimpleGMSSample.main(SimpleGMSSample.java:25)

      Also, Mike W provided the following stack trace in his email :
      Also has anyone run the tests lately? GroupLeaderTest fails,

      looks as though ClusterManager line 161

      è this.bindInterfaceAddress =
      (String)props.get(JxtaConfigConstants.BIND_INTERFACE_ADDRESS.toString());

      requires the BIND_INTERFACE_ADDRESS property to be given or throws null pointer?

      --ekiM

        Activity

        Hide
        shreedhar_ganapathy added a comment -

        Relevant Checkins
        https://shoal.dev.java.net/servlets/ReadMsg?list=cvs&msgNo=611

        And

        User: shreedhar_ganapathy
        Date: 2008-06-28 15:06:07+0000
        Modified:
        shoal/gms/src/java/com/sun/enterprise/jxtamgmt/ClusterManager.java

        Log:
        Fix for issue 67 : NPE in setting Bind interface address in ClusterManager Line
        161: Added check for empty Properties object.

        File Changes:

        Directory: /shoal/gms/src/java/com/sun/enterprise/jxtamgmt/
        ===========================================================

        File [changed]: ClusterManager.java
        Url:
        https://shoal.dev.java.net/source/browse/shoal/gms/src/java/com/sun/enterprise/jxtamgmt/ClusterManager.java?r1=1.38&r2=1.39
        Delta lines: +7 -24
        --------------------
        — ClusterManager.java 2008-06-26 12:56:11+0000 1.38
        +++ ClusterManager.java 2008-06-28 15:06:05+0000 1.39
        @@ -36,41 +36,23 @@

        package com.sun.enterprise.jxtamgmt;

        -import static com.sun.enterprise.jxtamgmt.JxtaUtil.getObjectFromByteArray;
        import com.sun.enterprise.ee.cms.core.MemberNotInViewException;
        -import net.jxta.document.AdvertisementFactory;
        -import net.jxta.document.MimeMediaType;
        -import net.jxta.document.StructuredDocument;
        -import net.jxta.document.StructuredDocumentFactory;
        -import net.jxta.document.XMLDocument;
        -import net.jxta.endpoint.ByteArrayMessageElement;
        -import net.jxta.endpoint.EndpointAddress;
        -import net.jxta.endpoint.Message;
        -import net.jxta.endpoint.MessageElement;
        -import net.jxta.endpoint.TextDocumentMessageElement;
        +import static com.sun.enterprise.jxtamgmt.JxtaUtil.getObjectFromByteArray;
        +import net.jxta.document.*;
        +import net.jxta.endpoint.*;
        import net.jxta.exception.PeerGroupException;
        import net.jxta.id.ID;
        import net.jxta.impl.endpoint.tcp.TcpTransport;
        import net.jxta.impl.pipe.BlockingWireOutputPipe;
        import net.jxta.peer.PeerID;
        import net.jxta.peergroup.PeerGroup;
        -import net.jxta.pipe.InputPipe;
        -import net.jxta.pipe.OutputPipe;
        -import net.jxta.pipe.PipeMsgEvent;
        -import net.jxta.pipe.PipeMsgListener;
        -import net.jxta.pipe.PipeService;
        +import net.jxta.pipe.*;
        import net.jxta.protocol.PipeAdvertisement;
        import net.jxta.protocol.RouteAdvertisement;

        import java.io.IOException;
        import java.io.Serializable;
        -import java.util.ArrayList;
        -import java.util.Collections;
        -import java.util.HashMap;
        -import java.util.Hashtable;
        -import java.util.Iterator;
        -import java.util.List;
        -import java.util.Map;
        +import java.util.*;
        import java.util.concurrent.ConcurrentHashMap;
        import java.util.logging.Level;
        import java.util.logging.Logger;
        @@ -158,8 +140,9 @@
        LOG.log(Level.WARNING, ioe.getLocalizedMessage());
        }
        NetworkManagerRegistry.add(groupName, netManager);

        • if ( props != null )
          + if(props !=null && !props.isEmpty()) { this.bindInterfaceAddress = (String)props.get(JxtaConfigConstants.BIND_INTERFACE_ADDRESS.toString()); + }

          systemAdv = createSystemAdv(netManager.getNetPeerGroup(), instanceName,
          identityMap, bindInterfaceAddress);
          LOG.log(Level.FINER, "Instance ID :" + getSystemAdvertisement().getID());
          this.clusterViewManager = new
          ClusterViewManager(getSystemAdvertisement(), this, viewListeners);

        Show
        shreedhar_ganapathy added a comment - Relevant Checkins https://shoal.dev.java.net/servlets/ReadMsg?list=cvs&msgNo=611 And User: shreedhar_ganapathy Date: 2008-06-28 15:06:07+0000 Modified: shoal/gms/src/java/com/sun/enterprise/jxtamgmt/ClusterManager.java Log: Fix for issue 67 : NPE in setting Bind interface address in ClusterManager Line 161: Added check for empty Properties object. File Changes: Directory: /shoal/gms/src/java/com/sun/enterprise/jxtamgmt/ =========================================================== File [changed] : ClusterManager.java Url: https://shoal.dev.java.net/source/browse/shoal/gms/src/java/com/sun/enterprise/jxtamgmt/ClusterManager.java?r1=1.38&r2=1.39 Delta lines: +7 -24 -------------------- — ClusterManager.java 2008-06-26 12:56:11+0000 1.38 +++ ClusterManager.java 2008-06-28 15:06:05+0000 1.39 @@ -36,41 +36,23 @@ package com.sun.enterprise.jxtamgmt; -import static com.sun.enterprise.jxtamgmt.JxtaUtil.getObjectFromByteArray; import com.sun.enterprise.ee.cms.core.MemberNotInViewException; -import net.jxta.document.AdvertisementFactory; -import net.jxta.document.MimeMediaType; -import net.jxta.document.StructuredDocument; -import net.jxta.document.StructuredDocumentFactory; -import net.jxta.document.XMLDocument; -import net.jxta.endpoint.ByteArrayMessageElement; -import net.jxta.endpoint.EndpointAddress; -import net.jxta.endpoint.Message; -import net.jxta.endpoint.MessageElement; -import net.jxta.endpoint.TextDocumentMessageElement; +import static com.sun.enterprise.jxtamgmt.JxtaUtil.getObjectFromByteArray; +import net.jxta.document.*; +import net.jxta.endpoint.*; import net.jxta.exception.PeerGroupException; import net.jxta.id.ID; import net.jxta.impl.endpoint.tcp.TcpTransport; import net.jxta.impl.pipe.BlockingWireOutputPipe; import net.jxta.peer.PeerID; import net.jxta.peergroup.PeerGroup; -import net.jxta.pipe.InputPipe; -import net.jxta.pipe.OutputPipe; -import net.jxta.pipe.PipeMsgEvent; -import net.jxta.pipe.PipeMsgListener; -import net.jxta.pipe.PipeService; +import net.jxta.pipe.*; import net.jxta.protocol.PipeAdvertisement; import net.jxta.protocol.RouteAdvertisement; import java.io.IOException; import java.io.Serializable; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Iterator; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.logging.Level; import java.util.logging.Logger; @@ -158,8 +140,9 @@ LOG.log(Level.WARNING, ioe.getLocalizedMessage()); } NetworkManagerRegistry.add(groupName, netManager); if ( props != null ) + if(props !=null && !props.isEmpty()) { this.bindInterfaceAddress = (String)props.get(JxtaConfigConstants.BIND_INTERFACE_ADDRESS.toString()); + } systemAdv = createSystemAdv(netManager.getNetPeerGroup(), instanceName, identityMap, bindInterfaceAddress); LOG.log(Level.FINER, "Instance ID :" + getSystemAdvertisement().getID()); this.clusterViewManager = new ClusterViewManager(getSystemAdvertisement(), this, viewListeners);

          People

          • Assignee:
            sheetalv
            Reporter:
            shreedhar_ganapathy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: