java.lang.NoSuchMethodError: com.mongodb.ReadPreference.primary()Lcom/mongodb/ReadPreference;

JIRA | Mike Delano | 4 years ago
tip
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    Mongodb database is not created

    Stack Overflow | 1 year ago | Dhiraj
    java.lang.NoSuchMethodError: com.mongodb.ReadPreference.primary()Lcom/mongodb/ReadPreference;
  2. 0

    error java.lang.NoSuchMethodError in java-mongodb example

    Stack Overflow | 4 months ago | Vikas
    java.lang.NoSuchMethodError: com.mongodb.ReadPreference.primary()Lcom/mongodb/ReadPreference;
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    java code gives error in mongodb while compiling

    Stack Overflow | 3 months ago | Kawinesh SK
    java.lang.NoSuchMethodError: org.bson.BsonDocument.clone()Lorg/bson/BsonDocument;

    3 unregistered visitors

    Root Cause Analysis

    1. java.lang.NoSuchMethodError

      com.mongodb.ReadPreference.primary()Lcom/mongodb/ReadPreference;

      at com.mongodb.MongoClientOptions$Builder.<init>()
    2. MongoDB Java Driver
      MongoClient.<init>
      1. com.mongodb.MongoClientOptions$Builder.<init>(MongoClientOptions.java:51)
      2. com.mongodb.MongoClient.<init>(MongoClient.java:126)
      3. com.mongodb.MongoClient.<init>(MongoClient.java:91)
      3 frames
    3. com.mediasilo.commons
      MongoDB.getDatabase
      1. com.mediasilo.commons.data.database.MongoDB.getDatabase(MongoDB.java:24)
      1 frame
    4. test.com.mediasilo
      MongoDBTests.getDatabase_suceeds
      1. test.com.mediasilo.commons.data.dao.MongoDBTests.getDatabase_suceeds(MongoDBTests.java:12)
      1 frame