com.mongodb.MongoServerSelectionException: Unable to connect to any server that satisfies the selector CompositeServerSelector{serverSelectors=[NoOpServerSelector{}, ReadPreferenceServerSelector{readPreference=primary}, LatencyMinimizingServerSelector{acceptableLatencyDifference=15, timeUnit=MILLISECONDS}]}

Google Groups | Unknown author | 3 years ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to poroszd . Or join the community to write better ones.
  1. 0

    MongoServerSelectionException: Unable to connect to any server that satisfies the selector

    Google Groups | 3 years ago | Unknown author
    com.mongodb.MongoServerSelectionException: Unable to connect to any server that satisfies the selector CompositeServerSelector{serverSelectors=[NoOpServerSelector{}, ReadPreferenceServerSelector{readPreference=primary}, LatencyMinimizingServerSelector{acceptableLatencyDifference=15, timeUnit=MILLISECONDS}]}
  2. 0
    samebug tip
    If MongoDB is installed on the same instance as your app, use localhost to connect to MongoDB, e.g. 127.0.0.1:27017.
  3. 0

    MongoServerSelectionException :MongoDB replica implementation

    Stack Overflow | 9 hours ago | user2269170
    com.mongodb.MongoServerSelectionException: Unable to connect to any server that matches {serverSelectors=[ReadPreferenceServerSelector{readPreference=primary}, LatencyMinimizingServerSelector{acceptableLatencyDifference=15 ms}]}
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. com.mongodb.MongoServerSelectionException

      Unable to connect to any server that satisfies the selector CompositeServerSelector{serverSelectors=[NoOpServerSelector{}, ReadPreferenceServerSelector{readPreference=primary}, LatencyMinimizingServerSelector{acceptableLatencyDifference=15, timeUnit=MILLISECONDS}]}

      at com.mongodb.BaseCluster.getServer()
    2. MongoDB Java Driver
      DBCursor.one
      1. com.mongodb.BaseCluster.getServer(BaseCluster.java:79)
      2. com.mongodb.DBTCPConnector.getServer(DBTCPConnector.java:649)
      3. com.mongodb.DBTCPConnector.access$300(DBTCPConnector.java:42)
      4. com.mongodb.DBTCPConnector$MyPort.getConnection(DBTCPConnector.java:508)
      5. com.mongodb.DBTCPConnector$MyPort.get(DBTCPConnector.java:456)
      6. com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:287)
      7. com.mongodb.DBTCPConnector.call(DBTCPConnector.java:272)
      8. com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:77)
      9. com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:60)
      10. com.mongodb.DBCollection.findOne(DBCollection.java:869)
      11. com.mongodb.DBCursor.one(DBCursor.java:677)
      11 frames
    3. casbah-core
      MongoCollection.findOne
      1. com.mongodb.casbah.MongoCollectionBase$class.findOne(MongoCollection.scala:260)
      2. com.mongodb.casbah.MongoCollection.findOne(MongoCollection.scala:1109)
      2 frames
    4. com.adbrain.segment
      CasbahSegmentDAO.getSegment
      1. com.adbrain.segment.store.casbah.CasbahSegmentDAO.getSegment(CasbahSegmentDAO.scala:87)
      1 frame