I am trying to connect my java project to an online mongo database. I faced some issues so I decided to first try to connect on a local mongo DB but I still have the same problem.
I am using the 3 mongodb libraries (driver,driver-async and driver-core), 3.3.0 version and the bson library, 3.2.2 version.
When I launch my 'helloworld example' , copied from here : http://www.mkyong.com/mongodb/java-mongodb-hello-world-example/
I have the following errors :
Exception in thread "main" java.lang.NoClassDefFoundError: org/bson/codecs/IterableCodecProvider
at com.mongodb.MongoClient.<clinit>(MongoClient.java:84)
at mainClass.main(mainClass.java:24)
Caused by: java.lang.ClassNotFoundException: org.bson.codecs.IterableCodecProvider
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 2 more
Note : The example code uses a method which is now deprecated, but even by replacing the code with the new version of it (using MongoClient), I still have the same errors.