[JAVA-3167] mongodb+srv schema can cause NullPointerException Created: 08/Feb/19  Updated: 28/Oct/23  Resolved: 11/Feb/19

Status: Closed
Project: Java Driver
Component/s: Cluster Management
Affects Version/s: None
Fix Version/s: 3.10.1

Type: Bug Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate

 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)



 Comments   
Comment by Githook User [ 14/Feb/19 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Fix NullPointerException when using mongodb+srv scheme

JAVA-3167
Branch: 4.x
https://github.com/mongodb/mongo-java-driver/commit/1e414abe8f290c3cd522d11e277c7326d033744a

Comment by Githook User [ 11/Feb/19 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Fix NullPointerException when using mongodb+srv scheme

JAVA-3167
Branch: 3.10.x
https://github.com/mongodb/mongo-java-driver/commit/66dcabe7bfd926791583afd04b5a9cf8ee6872ae

Comment by Githook User [ 11/Feb/19 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Fix NullPointerException when using mongodb+srv scheme

JAVA-3167
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/1e414abe8f290c3cd522d11e277c7326d033744a

Generated at Thu Feb 08 08:58:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.