Closed sidvanarse closed 4 years ago
Hello, can you provide a part of code how you try to connect?
Code is very simple. PFB:
JsonObject mongoconfig = new JsonObject()
.put("connection_string", "mongodb://localhost:27017")
.put("db_name", "test");
MongoClient mongoClient = MongoClient.createShared(vertx, mongoconfig);
JsonObject document = new JsonObject()
.put("title", "The Hobbit");
mongoClient.save("books", document, res -> {
if (res.succeeded()) {
String id = res.result();
System.out.println("Saved book with id " + id);
} else {
res.cause().printStackTrace();
}
});
@sidvanarse Still needing help?
no response so closing
Hi I am getting following exception when i try to connect to mongoDB using vertx jmongo client. However i am able to connect to mongoDB using java mongodb driver client. So seems to be issue with vertx mongo client only.
No server chosen by WritableServerSelector from cluster description ClusterDescription{type=UNKNOWN, connectionMode=SINGLE, serverDescriptions=[ServerDescription{address=localhost:27017, type=UNKNOWN, state=CONNECTING, exception={com.mongodb.MongoException: java.io.IOException: ConnectEx failed}, caused by {java.io.IOException: ConnectEx failed}}]}. Waiting for 30000 ms before timing out