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

mongodb+srv schema can cause NullPointerException

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.10.1
    • Component/s: Cluster Management
    • Labels:
      None

      Description

      If the MongoClient is used to execute an operation before SRV lookup complete, a NullPointerException will be thrown.

      Exception in thread "main" java.lang.NullPointerException
      	at com.mongodb.internal.connection.BaseCluster.getDescription(BaseCluster.java:176)
      	at com.mongodb.internal.connection.AbstractMultiServerCluster.getDescription(AbstractMultiServerCluster.java:53)
      	at com.mongodb.client.internal.MongoClientDelegate.getConnectedClusterDescription(MongoClientDelegate.java:136)
      	at com.mongodb.client.internal.MongoClientDelegate.createClientSession(MongoClientDelegate.java:94)
      	at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.getClientSession(MongoClientDelegate.java:249)
      	at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:172)
      	at com.mongodb.client.internal.MongoDatabaseImpl.executeCommand(MongoDatabaseImpl.java:184)
      	at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:153)
      	at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:148)
      	at com.mongodb.client.internal.MongoDatabaseImpl.runCommand(MongoDatabaseImpl.java:138)
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              jeff.yemin Jeffrey Yemin
              Reporter:
              jeff.yemin Jeffrey Yemin
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: