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

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by Vikas
, 1 year ago
com.mongodb.ReadPreference.primary()Lcom/mongodb/ReadPreference;
via Stack Overflow by Dhiraj
, 2 years ago
com.mongodb.ReadPreference.primary()Lcom/mongodb/ReadPreference;
java.lang.NoSuchMethodError: com.mongodb.ReadPreference.primary()Lcom/mongodb/ReadPreference;
at com.mongodb.MongoClientOptions$Builder.(MongoClientOptions.java:51)
at com.mongodb.MongoClient.(MongoClient.java:126)
at com.mongodb.MongoClient.(MongoClient.java:91)
at com.mediasilo.commons.data.database.MongoDB.getDatabase(MongoDB.java:24)
at test.com.mediasilo.commons.data.dao.MongoDBTests.getDatabase_suceeds(MongoDBTests.java:12)

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.