java.lang.NoClassDefFoundError when using MongoDB driver

You have java.lang.NoClassDefFoundError – that means your class is missed during runtime (not during build/compile time). So you should open your “Run Configurations” dialog for the project (project context menu -> “Run As” -> “Run Configurations…”) and make sure you have bson-xxx.jar, mongodb-driver-xxx.jar, and mongodb-driver-core-xxx.jar somehow listed in Classpath tab. And yes, like Xavier Bouclet … Read more

Why is PyMongo 3 giving ServerSelectionTimeoutError?

We’re investigating this problem, tracked in PYTHON-961. You may be able to work around the issue by passing connect=False when creating instances of MongoClient. That defers background connection until the first database operation is attempted, avoiding what I suspect is a race condition between spin up of MongoClient’s monitor thread and multiprocess forking.

A timeout occured after 30000ms selecting a server using CompositeServerSelector

Add “?connect=replicaSet” to the end of your connection string if connecting to MongoLab. new MongoClient(“mongodb://username:[email protected]:11111/db-name?connect=replicaSet”) This JIRA ticket has some details: https://jira.mongodb.org/browse/CSHARP-1160 Basically the default is to connect to a replica set member. But MongoLab’s Single-Node settings are actually a single node replica set and this causes us to not trust it. Appending ?connect=replicaSet to … Read more