Unexpected error in org.bson.BsonValue

Hey there

I am attempting to run liquibase against Mongo Atlas. I have previously had this exact setup working on an old driver (3.12.7). Feeling brave, I then ran a triple upgrade locally! So I now have:

Liquibase version 4.3.5
Mongodb extension 4.3.5 (see Release v4.3.5 · liquibase/liquibase-mongodb · GitHub)
Mongo JDBC Driver 4.2.3 (Central Repository: org/mongodb/mongodb-driver-core/4.2.3)

I have loaded both the extension and drivers jars into the lib folder of my local liquibase install

I have a very simple change log that just creates a single collection, I wont bother to show this because I dont believe its even getting this far now

I then execute a status command against my db:

liquibase --changeLogFile=db.changelog-master.xml --loglevel=debug --url=“mongodb+srv://:@/?retryWrites=true&w=majority” status

What I get back is a little confusing, I suspect I may have missed some compatibility issues somewhere that I have completely missed? or there is something wrong with my path or something, even if i supply classpath and point it directly at the driver it fails.

Here is the stack trace, any help would be greatly appreciated

[2021-05-28 20:08:21] FINE [liquibase.servicelocator] Loaded liquibase.database.Database instance liquibase.ext.mongodb.database.MongoLiquibaseDatabase
[2021-05-28 20:08:21] FINE [liquibase.database] Properties:
[2021-05-28 20:08:21] FINE [liquibase.database] Connecting to the URL:‘xxxxxxxx’ using driver:‘liquibase.ext.mongodb.database.MongoClientDriver’
[2021-05-28 20:08:21] FINE [liquibase.servicelocator] Loaded liquibase.database.DatabaseConnection instance liquibase.database.jvm.JdbcConnection
[2021-05-28 20:08:21] FINE [liquibase.servicelocator] Loaded liquibase.database.DatabaseConnection instance com.datical.liquibase.ext.database.jvm.ProJdbcConnection
[2021-05-28 20:08:21] FINE [liquibase.servicelocator] Loaded liquibase.database.DatabaseConnection instance liquibase.ext.mongodb.database.MongoConnection
[2021-05-28 20:08:21] WARNING [com.mongodb.diagnostics.logging.Loggers shouldUseSLF4J] SLF4J not found on the classpath. Logging is disabled for the ‘org.mongodb.driver’ component
Unexpected error running Liquibase: org.bson.BsonValue
For more information, please use the --logLevel flag
[2021-05-28 20:08:21] SEVERE [liquibase.integration] Unexpected error running Liquibase: org.bson.BsonValue
java.lang.NoClassDefFoundError: org/bson/BsonValue
at com.mongodb.ConnectionString.buildWriteConcern(ConnectionString.java:907)
at com.mongodb.ConnectionString.createWriteConcern(ConnectionString.java:639)
at com.mongodb.ConnectionString.translateOptions(ConnectionString.java:562)
at com.mongodb.ConnectionString.(ConnectionString.java:394)
at liquibase.ext.mongodb.database.MongoConnection.open(MongoConnection.java:96)
at liquibase.database.ConnectionServiceFactory.create(ConnectionServiceFactory.java:33)
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:214)
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.java:176)
at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java:141)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObject(CommandLineUtils.java:96)
at liquibase.integration.commandline.Main.doMigration(Main.java:1432)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:367)
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.integration.commandline.Main$1.run(Main.java:366)
at liquibase.integration.commandline.Main$1.run(Main.java:196)
at liquibase.Scope.child(Scope.java:169)
at liquibase.Scope.child(Scope.java:145)
at liquibase.integration.commandline.Main.run(Main.java:196)
at liquibase.integration.commandline.Main.main(Main.java:158)
Caused by: java.lang.ClassNotFoundException: org.bson.BsonValue
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
… 22 more

Hi @spozza ,

May we see the complete stack trace? Looking for a “Caused by…” clause. Even better would be the compelete output from liquibase (use logLevel=debug).