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
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.