Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-382

NPE in ReplicaSetStatus.ensureMaster

      After initializing a Mongo object I sometimes get a NPE when I first try to use that instance.

      java.lang.NullPointerException
      at
      com.mongodb.ReplicaSetStatus.ensureMaster(ReplicaSetStatus.java:301)
      at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:
      383)
      at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:192)
      at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:
      295)
      at com.mongodb.DB.getCollectionNames(DB.java:259)
      at com.mongodb.DB.collectionExists(DB.java:300)
      at
      net.avail.db.mongodb.MongoHourlyMetricsAggregator.ensureCollectionsExists(MongoHourlyMetricsAggregator.java:
      43)

      Expected:

      Better concurrency handling and on an unexpected error such as no master found a more descriptive exception than a NPE.

            Assignee:
            antoine Antoine Girbal
            Reporter:
            jon.ivmark Jon Ivmark
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: