Hi everyone, I introduce myself, I am a new user who is starting to use Liquibase on some database categories, at the moment it is used for Oracle, MSSql and PostgreSQL and MongoDB. As for the first three apart from some initial difficulties (especially for non-Oracle) I was able to use liquibase, while for Mongo I read and reread everything I found and I realized that:
- A specific driver is required
- A specific plug-in is required
- Both must be put in the lib folder of the Liquibase jdk in use but when I go to make the call I always get the same error, that is:
Starting Liquibase at 14:52:50 (version 4.1.0 #3 built at 2020-09-28 21:02+0000)
Unexpected error running Liquibase: java.lang.RuntimeException: Cannot find data base driver: mongodb.jdbc.MongoDriver
For more information, please use the --logLevel flag
[2021-04-23 14:52:50] SEVERE [liquibase.integration] Unexpected error running Li quibase: java.lang.RuntimeException: Cannot find database driver: mongodb.jdbc.M ongoDriver
liquibase.exception.DatabaseException: liquibase.exception.DatabaseException: ja va.lang.RuntimeException: Cannot find database driver: mongodb.jdbc.MongoDriver
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObje ct(CommandLineUtils.java:126)
at liquibase.integration.commandline.Main.doMigration(Main.java:1408)
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: liquibase.exception.DatabaseException: java.lang.RuntimeException: Ca nnot find database driver: mongodb.jdbc.MongoDriver
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.jav a:250)
at liquibase.database.DatabaseFactory.openDatabase(DatabaseFactory.java: 140)
at liquibase.integration.commandline.CommandLineUtils.createDatabaseObje ct(CommandLineUtils.java:91)
… 14 more
Caused by: java.lang.RuntimeException: Cannot find database driver: mongodb.jdbc .MongoDriver
at liquibase.database.DatabaseFactory.openConnection(DatabaseFactory.jav a:192)
… 16 more
This is the call I make:
/space/toolchain/liquibase4.1.0/liquibase --changeLogFile=changesetMarianoMongo.xlm --classpath=/space/toolchain/liquibase4.1.0/mongo-java-driver-3.12.7.jar --driver=mongodb.jdbc.MongoDriver --url=“jdbc:mongodb://ip:porta/nomeDB” --username=user --password=pwd history
Of course I hid the key parameters. The version of liquibase used is 4.1.0, the version of the plugin is liquibase-mongodb-4.3.3, the driver version is mongo-java-driver-3.12.7.jar and the jdk is 1.8
Can anyone help me understand where am I wrong and why? I also followed the instructions in this link to the letter: Using Liquibase with MongoDB | Liquibase Docs
Plus I just put the driver (or at least what I think is the call driver) where I put the others for the other db’s and call the one from the classtpath. Thanks everyone in advance.