Liquibase Failed to update mongodb

Simple Maven Java project fail to update my mongodb
when try to acquire lock with DATABASECHANGELOGLOCK collection.

Any ideas?


public class App {
public static void main(String args) {
try {
String url = “mongodb://localhost:27017/test_db_mine?socketTimeoutMS=1000&connectTimeoutMS=1000&serverSelectionTimeoutMS=1000”;
MongoLiquibaseDatabase database = (MongoLiquibaseDatabase) DatabaseFactory.getInstance().openDatabase(url, null, null, null, null);
Liquibase liquibase = new Liquibase(“liquibase/changelog.xml”, new ClassLoaderResourceAccessor(), database);
System.out.println(“Liquibase Updated!”);
} catch (Exception e){


<ext:createCollection collectionName=“person”/>


Oct 14, 2021 4:49:02 PM com.mongodb.diagnostics.logging.Loggers shouldUseSLF4J
WARNING: SLF4J not found on the classpath. Logging is disabled for the ‘org.mongodb.driver’ component
Oct 14, 2021 4:49:03 PM liquibase.ext
INFO: Create Database Lock Collection: test_db_mine.DATABASECHANGELOGLOCK
Oct 14, 2021 4:49:03 PM liquibase.ext
INFO: Created database lock Collection: DATABASECHANGELOGLOCK
liquibase.exception.LockException: java.lang.NullPointerException

Thanks for all feedback!

Hi @Stefano I noticed that you are using Liquibase 4.5.0 and the 4.2.2 extension. Can you update the extension and see if that fixes your issue?

Hi @alexandru.slobodcico , Could you take a look into this? Thank you :slightly_smiling_face:

Hi @Stefano , I also noticed that you did not pass in a user and password in your code. Do you have that stored somewhere else? Also can you add a logLevel=FINE to see where this error might be coming from too?