Error when connection to MongoDB database

  • After careful consideration and due to limited usage, we’ve made the decision to discontinue the PaperMC forums. Moving forward, we recommend using Hangar for plugin uploads, and for all other community discussions and support, please join us on Discord.

rqiiz_

New member
Nov 17, 2024
1
0
1
Hello, I have this error when i want to connect me to a mongoDB database.
This code worked fine with a simple java class but not when i implement it into a plugin.

public void connectBdd() {
System.out.println("Connecting to BDD");
String connectionString = "mongodb+srv://<user><pwd>@throughthetimeless.5e0sk.mongodb.net/?retryWrites=true&w=majority&appName=ThroughTheTimeless";
MongoClient mongoClient = MongoClients.create(connectionString);
}
(<user> and <pwd> are hidden).

1731880199358.png
 
Version Output
1.21