I'm trying to use Morphia (MongoDB) in a Tomcat application. But I'm getting this Error:
The given link confirms that the JAR files are missing.
In the pom.xml file Morphia is added with compile as scope.
<dependency>
<groupId>dev.morphia.morphia</groupId>
<artifactId>core</artifactId>
<version>1.5.3</version>
<scope>compile</scope>
</dependency>
All dependencies are added as library and are useable inside Eclipse.
But only Morphia itself is being compiled.
With a look at MVNrepository I suspected that only "Compile Dependencies" and not "Test Dependencies" are being compiled.
But adding SLF4J API additionally to pom.xml didn't change anything.
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.8.0-beta2</version>
<scope>compile</scope>
</dependency>
Like @eis and the given link said I had to add a provider, not only the API.
But also the Versions were incompatible. If anyone else has this problem use this versions:
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongodb-driver-sync</artifactId>
<version>4.2.3</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>dev.morphia.morphia</groupId>
<artifactId>morphia-core</artifactId>
<version>2.1.5</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.8.0-beta2</version>
<scope>compile</scope>
</dependency>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.