I'm using the free version of mongoDB Atlas. There is only one user with admin rights, no ip whitelist or other things. My application is supposed to connect using the admin user.
Here's the connection line I'm using (obv I've hidden the password):
client = MongoClients.create("mongodb+srv://Jules:xxxxxx@onimacluster-7wakg.gcp.mongodb.net/test?retryWrites=true&w=majority");
database = client.getDatabase("onima");
On my pc it works just fine, no errors, I'm getting connected to the clusters. But on my friend's pc nothing works, he only has this error displayed :
[19:15:51 ERROR]: Error occurred while enabling OnimaAPI v1.0 (Is it up to date?)
java.lang.IllegalArgumentException: The connection string is invalid. Connection strings must start with 'mongodb://'
at com.mongodb.ConnectionString.<init>(ConnectionString.java:231) ~[spigot.jar:1]
at com.mongodb.client.MongoClients.create(MongoClients.java:61) ~[mongo-java-driver-3.11.0.jar:?]
at net.onima.onimaapi.mongo.OnimaMongo.connect(OnimaMongo.java:28) ~[?:?]
at net.onima.onimaapi.OnimaAPI.registerManager(OnimaAPI.java:117) ~[?:?]
at net.onima.onimaapi.OnimaAPI.onEnable(OnimaAPI.java:109) ~[?:?]
So I read a thread where someone had the same error. I did as he said in the answer, no errors on my pc again, everything works fine. But again on my friend's pc it doesn't work. Here's the error :
[19:31:44 WARN]: Unsupported option 'retrywrites' in the connection string 'mongodb://Jules:xxxxx@onimacluster-shard-00-00-7wakg.gcp.mongodb.net:27017,onimacluster-shard-00-01-7wakg.gcp.mongodb.net:27017,onimacluster-shard-00-02-7wakg.gcp.mongodb.net:27017/test?ssl=true&replicaSet=OnimaCluster-shard-0&authSource=admin&retryWrites=true&w=majority'.
[19:31:44 ERROR]: Error occurred while enabling OnimaAPI v1.0 (Is it up to date?)
java.lang.SecurityException: sealing violation: package com.mongodb is sealed
at java.net.URLClassLoader.getAndVerifyPackage(Unknown Source) ~[?:1.8.0_221]
at java.net.URLClassLoader.definePackageInternal(Unknown Source) ~[?:1.8.0_221]
at java.net.URLClassLoader.defineClass(Unknown Source) ~[?:1.8.0_221]
at java.net.URLClassLoader.access$100(Unknown Source) ~[?:1.8.0_221]
at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_221]