[/code]Running this yields the following runtime error:
com.vaadin.server.ServiceException: java.lang.NoClassDefFoundError: com/mongodb/MongoServerSelectionException
The mongodb-java-driver-2.12.0-rc0.jar is added to my classpath!
I’m puzzled why I get this error!
By the way, I tested the code above in a simple java project (within Eclipse, no Vaadin-7 project), which runs as aspected, and showing me a nice list of all the collections available!
Didn’t find any clue on the Internet on how to properly setup Vaadin-7 project with MongoDB! So, that’s why I’m turning to this forum, to help me find a possible solution to this issue!
I don’t think you have added the Mongo DB jar to the classpath. Please add the Driver jar to the folder WEB-INF/lib and run. If you still find an issue with this, please share the stripped down war. I will check and get back to you.
“Didn’t find any clue on the Internet on how to properly setup Vaadin-7 project with MongoDB!”
There is no specific set up required. Just add the driver jar to the class path(WEB-INF/lib in case of war) From your Vaadin Classes call appropriate Java class or method that connects to the MongoDB and gets your results. It is as simple as that.