Mongodb driver with liquibase cli

For mysql i could use driver to connect to mysql using liquibase cli but with mongodb im unable to find driver. Can anyone guide on this?

Hi @ndalal1787 - Welcome to the Liquibase Community!

We have a guide for using Liquibase with MongoDB that links to the drivers you need.

Thanks for the Guide, We’re using MongoDB 4.0.23 Community and Liquibase Open Source Version 4.10. We did POC on MySQL and it worked without any issues. While checking for MongoDB it failed with a lot of errors “Can’t find a codec for interface java.util.List”.

Following are the steps we followed:

  1. Liquibase CLI installed on system version 4.10
  2. Copied MongoDB driver (liquibase-mongodb-4.10.0.jar, mongo-java-driver-3.10.0.jar) on /liquibase_/lib folder
  3. Created .sql file and properties file.
url=mongodb://<server>/test?authSource=test
username=test
password=test
changeLogFile=changelog.sql
  1. ran liquibase status => works fine and liquibase update => shows an error (Can’t find a codec for interface java.util.List)
    Can you please help us to solve this issue?
[2022-05-20 11:18:56] FINE [com.mongodb.diagnostics.logging.JULLogger log] Execution of command with request id 11 completed successfully in 260.11 ms on connection [connectionId{localValue:2, serverValue:754}] to server 10.2.11.7:27017
[2022-05-20 11:18:56] FINE [liquibase.configuration] No configuration value for liquibase.mongodb.adjustTrackingTablesOnStartup
found
[2022-05-20 11:18:56] FINE [liquibase.configuration] Configuration liquibase.mongodb.adjustTrackingTablesOnStartup is using the
default value of true
[2022-05-20 11:18:56] INFO [liquibase.ext] Adjusting database Lock Collection with name: test.DATABASECHANGELOGLOCK
[2022-05-20 11:18:56] INFO [com.mongodb.diagnostics.logging.JULLogger log] Closed connection [connectionId{localValue:2, serverValue:754}] to ip:27017 because the pool has been closed.
[2022-05-20 11:18:56] FINE [com.mongodb.diagnostics.logging.JULLogger log] Closing connection connectionId{localValue:2, serverValue:754}
[2022-05-20 11:18:56] FINE [com.mongodb.diagnostics.logging.JULLogger log] Closing connection connectionId{localValue:1, serverValue:753}
[2022-05-20 11:18:56] SEVERE [liquibase.integration] org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for interface java.util.List.
liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: Can't find a codec for interface java.util.List.
        at liquibase.command.CommandScope.execute(CommandScope.java:163)
        at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:51)
        at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:21)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$1(LiquibaseCommandLine.java:325)
        at liquibase.Scope.child(Scope.java:189)
        at liquibase.Scope.child(Scope.java:165)
        at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:291)
        at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:80)
Caused by: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: Can't find a codec for interface java.util.List.
        at liquibase.integration.commandline.Main$1.run(Main.java:443)
        at liquibase.integration.commandline.Main$1.run(Main.java:221)
        at liquibase.Scope.child(Scope.java:189)
        at liquibase.Scope.child(Scope.java:165)
        at liquibase.integration.commandline.Main.run(Main.java:221)
        at liquibase.command.AbstractCliWrapperCommandStep.run(AbstractCliWrapperCommandStep.java:32)
        at liquibase.command.CommandScope.execute(CommandScope.java:157)
        ... 14 more
Caused by: liquibase.exception.LockException: org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for
interface java.util.List.
        at liquibase.nosql.lockservice.AbstractNoSqlLockService.acquireLock(AbstractNoSqlLockService.java:183)
        at liquibase.nosql.lockservice.AbstractNoSqlLockService.waitForLock(AbstractNoSqlLockService.java:119)
        at liquibase.Liquibase.lambda$update$1(Liquibase.java:214)
        at liquibase.Scope.lambda$child$0(Scope.java:180)
        at liquibase.Scope.child(Scope.java:189)
        at liquibase.Scope.child(Scope.java:179)
        at liquibase.Scope.child(Scope.java:158)
        at liquibase.Liquibase.runInScope(Liquibase.java:2405)
        at liquibase.Liquibase.update(Liquibase.java:211)
        at liquibase.Liquibase.update(Liquibase.java:197)
        at liquibase.integration.commandline.Main.doMigration(Main.java:1870)
        at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:398)
        at liquibase.Scope.lambda$child$0(Scope.java:180)
        at liquibase.Scope.child(Scope.java:189)
        at liquibase.Scope.child(Scope.java:179)
        at liquibase.Scope.child(Scope.java:158)
        at liquibase.integration.commandline.Main$1.run(Main.java:397)
        ... 20 more
Caused by: org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for interface java.util.List.
        at org.bson.codecs.BsonTypeCodecMap.get(BsonTypeCodecMap.java:68)
        at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:41)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
        at org.bson.internal.LazyCodec.decode(LazyCodec.java:48)
        at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:61)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
        at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:61)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
        at org.bson.Document.parse(Document.java:127)
        at liquibase.ext.mongodb.statement.BsonUtils.lambda$orEmptyDocument$0(BsonUtils.java:69)
        at java.base/java.util.Optional.map(Optional.java:265)
        at liquibase.ext.mongodb.statement.BsonUtils.orEmptyDocument(BsonUtils.java:69)
        at liquibase.ext.mongodb.statement.RunCommandStatement.<init>(RunCommandStatement.java:30)
        at liquibase.ext.mongodb.lockservice.AdjustChangeLogLockCollectionStatement.<init>(AdjustChangeLogLockCollectionStatement.java:40)
        at liquibase.ext.mongodb.lockservice.MongoLockService.adjustRepository(MongoLockService.java:101)
        at liquibase.nosql.lockservice.AbstractNoSqlLockService.init(AbstractNoSqlLockService.java:102)
        at liquibase.nosql.lockservice.AbstractNoSqlLockService.acquireLock(AbstractNoSqlLockService.java:155)
        ... 36 more


Unexpected error running Liquibase: org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for interface
java.util.List.

liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: Can't find a codec for interface java.util.List.
        at liquibase.command.CommandScope.execute(CommandScope.java:163)
        at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:51)
        at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:21)
        at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
        at picocli.CommandLine.access$1300(CommandLine.java:145)
        at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
        at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
        at picocli.CommandLine.execute(CommandLine.java:2078)
        at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$1(LiquibaseCommandLine.java:325)
        at liquibase.Scope.child(Scope.java:189)
        at liquibase.Scope.child(Scope.java:165)
        at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:291)
        at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:80)
Caused by: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: Can't find a codec for interface java.util.List.
        at liquibase.integration.commandline.Main$1.run(Main.java:443)
        at liquibase.integration.commandline.Main$1.run(Main.java:221)
        at liquibase.Scope.child(Scope.java:189)
        at liquibase.Scope.child(Scope.java:165)
        at liquibase.integration.commandline.Main.run(Main.java:221)
        at liquibase.command.AbstractCliWrapperCommandStep.run(AbstractCliWrapperCommandStep.java:32)
        at liquibase.command.CommandScope.execute(CommandScope.java:157)
        ... 14 more
Caused by: liquibase.exception.LockException: org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for
interface java.util.List.
        at liquibase.nosql.lockservice.AbstractNoSqlLockService.acquireLock(AbstractNoSqlLockService.java:183)
        at liquibase.nosql.lockservice.AbstractNoSqlLockService.waitForLock(AbstractNoSqlLockService.java:119)
        at liquibase.Liquibase.lambda$update$1(Liquibase.java:214)
        at liquibase.Scope.lambda$child$0(Scope.java:180)
        at liquibase.Scope.child(Scope.java:189)
        at liquibase.Scope.child(Scope.java:179)
        at liquibase.Scope.child(Scope.java:158)
        at liquibase.Liquibase.runInScope(Liquibase.java:2405)
        at liquibase.Liquibase.update(Liquibase.java:211)
        at liquibase.Liquibase.update(Liquibase.java:197)
        at liquibase.integration.commandline.Main.doMigration(Main.java:1870)
        at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:398)
        at liquibase.Scope.lambda$child$0(Scope.java:180)
        at liquibase.Scope.child(Scope.java:189)
        at liquibase.Scope.child(Scope.java:179)
        at liquibase.Scope.child(Scope.java:158)
        at liquibase.integration.commandline.Main$1.run(Main.java:397)
        ... 20 more
Caused by: org.bson.codecs.configuration.CodecConfigurationException: Can't find a codec for interface java.util.List.
        at org.bson.codecs.BsonTypeCodecMap.get(BsonTypeCodecMap.java:68)
        at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:41)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
        at org.bson.internal.LazyCodec.decode(LazyCodec.java:48)
        at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:61)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
        at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:61)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
        at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
        at org.bson.Document.parse(Document.java:127)
        at liquibase.ext.mongodb.statement.BsonUtils.lambda$orEmptyDocument$0(BsonUtils.java:69)
        at java.base/java.util.Optional.map(Optional.java:265)
        at liquibase.ext.mongodb.statement.BsonUtils.orEmptyDocument(BsonUtils.java:69)
        at liquibase.ext.mongodb.statement.RunCommandStatement.<init>(RunCommandStatement.java:30)
        at liquibase.ext.mongodb.lockservice.AdjustChangeLogLockCollectionStatement.<init>(AdjustChangeLogLockCollectionStatement.java:40)
        at liquibase.ext.mongodb.lockservice.MongoLockService.adjustRepository(MongoLockService.java:101)
        at liquibase.nosql.lockservice.AbstractNoSqlLockService.init(AbstractNoSqlLockService.java:102)
        at liquibase.nosql.lockservice.AbstractNoSqlLockService.acquireLock(AbstractNoSqlLockService.java:155)
        ... 36 more

Hello @ndalal1787 ,

Could you try changing the MongoDB community version you are using. I suspect the issue is becaus of the mongodb driver version getting used. Similar issue has been reported earlier with SpringBoot migration and the root cause was found to be the mongodb driver version changes in SpringBoot and Liquibase driver.

After some investigation, I figured out Spring Boot 2.6.1 uses 4.4.0 version of mongodb driver while liquibase-mongodb:4.6.2 uses 4.3.4. Seems like something has changed in Document.parse(...) in new driver version so that this line throws exception with provided DocumentCodec .

Could you please try your hands with some other MongoDB version. Liquibase 4.10 uses 4.3.4 version of mongodb driver. I’m not sure if you shoulf downgrade or upgrade the MongoDB version but you can help other users with whatever way you succeds :slight_smile: Please share the results once you give this a try.

Apologies for the issue you are facing.

Thanks,
Rakhi Agrawal

@ndalal1787 Looks like the latest build with 4.11 should resolve this issue. 4.11 should be releasing this week. Validated with the combination of the mongodb sync, core and bson 4.6.0 drivers that it works.

Thanks a lot, I will wait to get 4.11 verison and share response here.
Also i can give it a try to use 4.3.4 version of driver. Will share respose by this week…

@MikeOlivas , we tried with 4.11 as well but it gives me same error as before
@rakhi , we also tried with 4.3.4 driver but no luck.
Can you please help?

Hi @ndalal1787
Not sure what is different in your scenario.
It worked for me with the fix.
Can you share the details of the latest configuration do see if there is a difference between our configs?
Mongo version (and location, ie, cloud, local, VM, etc)
Driver versions of all drivers,
Liquibase version
etc.

Hi @MikeOlivas below are details

MongoDB version:5.0.1(gcp server on which we install mongodb service)

we tried with all below drivers:
liquibase-mongodb-4.8.0.jar
liquibase-mongodb-4.10.0.jar
mongodb-driver-core-4.3.4.jar
mongo-java-driver-3.9.1.jar
mongo-java-driver-3.9.1-javadoc.jar
mongo-java-driver-3.10.0.jar
mongo-java-driver-3.10.0-javadoc.jar
mongo-java-driver-3.10.0-sources.jar

Liquibase version: 4.11

liquibase.properties file:
classpath=C:\Program Files\liquibase\lib\mongodb-driver-core-4.3.4.jar
url=mongodb://database ip/databasename
username=username
password=password
changeLogFile=changelog.sql

please let me know if u need additional details.

In the latest java drivers, mongo split where they have class files.
I would try this set with the latest.
./liquibase-mongodb-4.11.jar:
./mongodb-driver-core-4.6.0.jar:
./mongodb-driver-sync-4.6.0.jar:
./bson-4.6.0.jar
The first comes from the liquibase extension.
The latter from MongoDb.

@MikeOlivas
still facing same issue after updating jar files.

image

PS E:\DMDA_Client\liquibase\mongo> liquibase update --log-level=INFO
####################################################

####################################################
Starting Liquibase at 12:38:13 (version 4.11.0 #2708 built at 2022-05-23 15:17+0000)
Liquibase Version: 4.11.0
Liquibase Community 4.11.0 by Liquibase
[2022-06-23 12:38:18] INFO [liquibase.ext] Create Database Lock Collection: test.DATABASECHANGELOGLOCK
[2022-06-23 12:38:18] INFO [liquibase.ext] Created database lock Collection: DATABASECHANGELOGLOCK
[2022-06-23 12:38:18] INFO [liquibase.ext] Adjusting database Lock Collection with name: test.DATABASECHANGELOGLOCK
[2022-06-23 12:38:18] SEVERE [liquibase.integration] org.bson.codecs.configuration.CodecConfigurationException: Can’t find a codec for interface java.util.List.
liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: Can’t find a codec for
interface java.util.List.
at liquibase.command.CommandScope.execute(CommandScope.java:163)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:51)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:21)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2078)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$1(LiquibaseCommandLine.java:336)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:165)
at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:301)
at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:90)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at liquibase.integration.commandline.LiquibaseLauncher.main(LiquibaseLauncher.java:91)
Caused by: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: Can’t find a codec for interface java.util.List.
at liquibase.integration.commandline.Main$1.run(Main.java:443)
at liquibase.integration.commandline.Main$1.run(Main.java:221)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:165)
at liquibase.integration.commandline.Main.run(Main.java:221)
at liquibase.command.AbstractCliWrapperCommandStep.run(AbstractCliWrapperCommandStep.java:32)
at liquibase.command.CommandScope.execute(CommandScope.java:157)
… 19 more
Caused by: liquibase.exception.LockException: org.bson.codecs.configuration.CodecConfigurationException: Can’t find a codec for interface java.util.List.
at liquibase.nosql.lockservice.AbstractNoSqlLockService.acquireLock(AbstractNoSqlLockService.java:183)
at liquibase.nosql.lockservice.AbstractNoSqlLockService.waitForLock(AbstractNoSqlLockService.java:119)
at liquibase.Liquibase.lambda$update$1(Liquibase.java:214)
at liquibase.Scope.lambda$child$0(Scope.java:180)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:179)
at liquibase.Scope.child(Scope.java:158)
at liquibase.Liquibase.runInScope(Liquibase.java:2405)
at liquibase.Liquibase.update(Liquibase.java:211)
at liquibase.Liquibase.update(Liquibase.java:197)
at liquibase.integration.commandline.Main.doMigration(Main.java:1869)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:398)
at liquibase.Scope.lambda$child$0(Scope.java:180)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:179)
at liquibase.Scope.child(Scope.java:158)
at liquibase.integration.commandline.Main$1.run(Main.java:397)
… 25 more
Caused by: org.bson.codecs.configuration.CodecConfigurationException: Can’t find a codec for interface java.util.List.
at org.bson.codecs.BsonTypeCodecMap.get(BsonTypeCodecMap.java:68)
at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:41)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
at org.bson.internal.LazyCodec.decode(LazyCodec.java:48)
at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:61)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:61)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
at org.bson.Document.parse(Document.java:127)
at liquibase.ext.mongodb.statement.BsonUtils.lambda$orEmptyDocument$0(BsonUtils.java:69)
at java.base/java.util.Optional.map(Optional.java:260)
at liquibase.ext.mongodb.statement.BsonUtils.orEmptyDocument(BsonUtils.java:69)
at liquibase.ext.mongodb.statement.RunCommandStatement.(RunCommandStatement.java:30)
at liquibase.ext.mongodb.lockservice.AdjustChangeLogLockCollectionStatement.(AdjustChangeLogLockCollectionStatement.java:40)
at liquibase.ext.mongodb.lockservice.MongoLockService.adjustRepository(MongoLockService.java:101)
at liquibase.nosql.lockservice.AbstractNoSqlLockService.init(AbstractNoSqlLockService.java:102)
at liquibase.nosql.lockservice.AbstractNoSqlLockService.acquireLock(AbstractNoSqlLockService.java:155)
… 41 more

Unexpected error running Liquibase: org.bson.codecs.configuration.CodecConfigurationException: Can’t find a codec for interface java.util.List.

liquibase.exception.CommandExecutionException: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: Can’t find a codec for
interface java.util.List.
at liquibase.command.CommandScope.execute(CommandScope.java:163)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:51)
at liquibase.integration.commandline.CommandRunner.call(CommandRunner.java:21)
at picocli.CommandLine.executeUserObject(CommandLine.java:1953)
at picocli.CommandLine.access$1300(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2352)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2346)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2311)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2179)
at picocli.CommandLine.execute(CommandLine.java:2078)
at liquibase.integration.commandline.LiquibaseCommandLine.lambda$execute$1(LiquibaseCommandLine.java:336)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:165)
at liquibase.integration.commandline.LiquibaseCommandLine.execute(LiquibaseCommandLine.java:301)
at liquibase.integration.commandline.LiquibaseCommandLine.main(LiquibaseCommandLine.java:90)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at liquibase.integration.commandline.LiquibaseLauncher.main(LiquibaseLauncher.java:91)
Caused by: liquibase.exception.LiquibaseException: Unexpected error running Liquibase: Can’t find a codec for interface java.util.List.
at liquibase.integration.commandline.Main$1.run(Main.java:443)
at liquibase.integration.commandline.Main$1.run(Main.java:221)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:165)
at liquibase.integration.commandline.Main.run(Main.java:221)
at liquibase.command.AbstractCliWrapperCommandStep.run(AbstractCliWrapperCommandStep.java:32)
at liquibase.command.CommandScope.execute(CommandScope.java:157)
… 19 more
Caused by: liquibase.exception.LockException: org.bson.codecs.configuration.CodecConfigurationException: Can’t find a codec for interface java.util.List.
at liquibase.nosql.lockservice.AbstractNoSqlLockService.acquireLock(AbstractNoSqlLockService.java:183)
at liquibase.nosql.lockservice.AbstractNoSqlLockService.waitForLock(AbstractNoSqlLockService.java:119)
at liquibase.Liquibase.lambda$update$1(Liquibase.java:214)
at liquibase.Scope.lambda$child$0(Scope.java:180)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:179)
at liquibase.Scope.child(Scope.java:158)
at liquibase.Liquibase.runInScope(Liquibase.java:2405)
at liquibase.Liquibase.update(Liquibase.java:211)
at liquibase.Liquibase.update(Liquibase.java:197)
at liquibase.integration.commandline.Main.doMigration(Main.java:1869)
at liquibase.integration.commandline.Main$1.lambda$run$0(Main.java:398)
at liquibase.Scope.lambda$child$0(Scope.java:180)
at liquibase.Scope.child(Scope.java:189)
at liquibase.Scope.child(Scope.java:179)
at liquibase.Scope.child(Scope.java:158)
at liquibase.integration.commandline.Main$1.run(Main.java:397)
… 25 more
Caused by: org.bson.codecs.configuration.CodecConfigurationException: Can’t find a codec for interface java.util.List.
at org.bson.codecs.BsonTypeCodecMap.get(BsonTypeCodecMap.java:68)
at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:41)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
at org.bson.internal.LazyCodec.decode(LazyCodec.java:48)
at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:61)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
at org.bson.codecs.ContainerCodecHelper.readValue(ContainerCodecHelper.java:61)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:180)
at org.bson.codecs.DocumentCodec.decode(DocumentCodec.java:44)
at org.bson.Document.parse(Document.java:127)
at liquibase.ext.mongodb.statement.BsonUtils.lambda$orEmptyDocument$0(BsonUtils.java:69)
at java.base/java.util.Optional.map(Optional.java:260)
at liquibase.ext.mongodb.statement.BsonUtils.orEmptyDocument(BsonUtils.java:69)
at liquibase.ext.mongodb.statement.RunCommandStatement.(RunCommandStatement.java:30)
at liquibase.ext.mongodb.lockservice.AdjustChangeLogLockCollectionStatement.(AdjustChangeLogLockCollectionStatement.java:40)
at liquibase.ext.mongodb.lockservice.MongoLockService.adjustRepository(MongoLockService.java:101)
at liquibase.nosql.lockservice.AbstractNoSqlLockService.init(AbstractNoSqlLockService.java:102)
at liquibase.nosql.lockservice.AbstractNoSqlLockService.acquireLock(AbstractNoSqlLockService.java:155)
… 41 more

Hello,
We are using Liquibase Open Source version 4.15.
I placed mongo-java-driver-3.12.11.jar and liquibase-mongodb-4.15.0.jar files in /liquibase/lib directory.
liquibase.properties file:

changeLogFile: dbchangelog.xml
classpath: /opt/liquibase/lib/mongo-java-driver-3.12.11.jar
url: mongodb://xxx.xx.xx.xx:27017/mydatabase

"liquibase status" command fails with the message:
Unexpected error running Liquibase: Driver class was not specified and could not be determined from the url

Any help/inputs is appreciated.
Thank you

Update:
I used Liquibase Open Source version 4.13 and it did not complain about the database driver not found as it did with version 4.15.
This narrowed it down to a problem with Liquibase Open Source version 4.15

@sruthispandana19 Do you mind creating a github issue for us to review on your specific case if you aren’t able to resolve it? We did some .jar splitting in v4.14, and I don’t think that is causing this, but I want to check with people who know way more about this stuff than I do. :slight_smile: