I have a custom add-on with which I need to connect to a MongoDB instance to. I have put the following dependencies in my pom file:
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
<version>3.7.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>bson</artifactId>
<version>3.7.0</version>
<scope>compile</scope>
</dependency>
I have also added the mongodb packages in the <Import-Package>
<Import-Package>
org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional",
org.bson.*;resolution:="optional",
com.mongodb.*;resolution:="optional", *
</Import-Package>
What am I doing wrong. Why does it still return the below error?
java.lang.NoClassDefFoundError: com/mongodb/MongoException