Unexpected error running Liquibase: com.mongodb.ConnectionString java.lang.NoClassDefFoundError: com/mongodb/ConnectionString

[2021-01-14 22:45:36] FINE [liquibase.servicelocator] Loaded liquibase.database.DatabaseConnection instance liquibase.ext.mongodb.database.MongoConnection
Unexpected error running Liquibase: com.mongodb.ConnectionString
For more information, please use the --logLevel flag
[2021-01-14 22:45:36] SEVERE [liquibase.integration] Unexpected error running Liquibase: com.mongodb.ConnectionString
java.lang.NoClassDefFoundError: com/mongodb/ConnectionString
at liquibase.ext.mongodb.database.MongoConnection.open(MongoConnection.java:102)
at liquibase.database.ConnectionServiceFactory.create(ConnectionServiceFactory.java:33)
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:213)
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:175)
at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:140)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:96)
at liquibase.integration.commandline.Main.doMigration(Main.java:1409)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:361)
at liquibase.Scope.lambda$child$0(Scope.java:160)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:159)
at liquibase.Scope.child(Scope.java:138)
at liquibase.Scope.child(Scope.java:222)
at liquibase.Scope.child(Scope.java:226)
at liquibase.integration.commandline.Main$1.run(Main.java:360)
at liquibase.integration.commandline.Main$1.run(Main.java:193)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:193)
at liquibase.integration.commandline.Main.main(Main.java:156)
Caused by: java.lang.ClassNotFoundException: com.mongodb.ConnectionString
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:419)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:352)
… 20 more

Hi @k4rslon34 ,

Looks like this is just a stack trace error from a liquibase command run. To better assist you we wil lneed more info:

  • Exact command ran (ex. if using command line, liquibase --logLevel=debug update)
  • Complete log, not just a snippet, context will help
  • liquibase.properties file contents (please redact confidential info) if you are using one.

Looking forward to helping!

Hi @k4rslon34 this due to the fact that java-driver is missing from your classpath. Please See perquisites section GitHub - liquibase/liquibase-mongodb: MongoDB extension for Liquibase. If the intent is to run on other DB than Mongo, is required the liquibase-mongodb.jar to be removed from your classpath as for now there is an incompatibility issue.