-
-
Notifications
You must be signed in to change notification settings - Fork 389
Description
I tried to create a simple example using Javers + Mongo + spring data + spring. It does not work and my application crashes before the context is initialized. I see that Javers uses deprecated api getDb on MongoClient below. The example on your website uses the constructor new Mongo() which is deprecated and fails as well. Am copying my code block, links to your website and stacktrace below.
Link to documentation:
http://javers.org/documentation/spring-integration/
Code:
public class JaversMongoMain {
public static void main(String args[]) {
MongoRepository mongoRepo = new MongoRepository(new MongoClient().getDB("test"));
System.out.print(3);
}
}
Stacktrace :
May 21, 2015 5:22:51 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Cluster created with settings {hosts=[127.0.0.1:27017], mode=SINGLE, requiredClusterType=UNKNOWN, serverSelectionTimeout='30000 ms', maxWaitQueueSize=500}
May 21, 2015 5:22:51 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Exception in monitor thread while connecting to server 127.0.0.1:27017
com.mongodb.MongoException: java.lang.IllegalAccessError: tried to access class com.mongodb.MongoNamespace from class com.mongodb.connection.CommandHelper
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:125)
at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:127)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalAccessError: tried to access class com.mongodb.MongoNamespace from class com.mongodb.connection.CommandHelper
at com.mongodb.connection.CommandHelper.sendMessage(CommandHelper.java:86)
at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32)
at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:83)
at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:43)
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:115)
... 2 more
May 21, 2015 5:23:01 PM com.mongodb.diagnostics.logging.JULLogger log
INFO: Exception in monitor thread while connecting to server 127.0.0.1:27017
com.mongodb.MongoException: java.lang.IllegalAccessError: com/mongodb/MongoNamespace
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:125)
at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:127)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalAccessError: com/mongodb/MongoNamespace
at com.mongodb.connection.CommandHelper.sendMessage(CommandHelper.java:86)
at com.mongodb.connection.CommandHelper.executeCommand(CommandHelper.java:32)
at com.mongodb.connection.InternalStreamConnectionInitializer.initializeConnectionDescription(InternalStreamConnectionInitializer.java:83)
at com.mongodb.connection.InternalStreamConnectionInitializer.initialize(InternalStreamConnectionInitializer.java:43)
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:115)
... 2 more