java.lang.NoClassDefFoundError when using MongoDB driver

前端 未结 2 452
迷失自我
迷失自我 2020-12-03 23:08

I am trying to connect to a MongoDB database hosted on mlab using the Java driver on a servlet.

import org.bson.Document; 
import com.mongodb.MongoClient;
im         


        
2条回答
  •  情深已故
    2020-12-03 23:30

    You have to make sure that the mongodb jars are exported to server if your call to the database are made from the servlet.

    Check how you deploy your app on your local server dans make sure the jars are there.

提交回复
热议问题