Simple Maven Java project fail to update my mongodb
when try to acquire lock with DATABASECHANGELOGLOCK collection.
Any ideas?
main:
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);
liquibase.update("");
System.out.println(“Liquibase Updated!”);
} catch (Exception e){
System.err.println(e);
}
}
}
changelog.xml:
<ext:createCollection collectionName=“person”/>
output:
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!