# Liquibase Failed to update mongodb

**URL:** <https://forum.liquibase.org/t/liquibase-failed-to-update-mongodb/6023>\
**Category:** General Discussion\
**Created:** [October 14, 2021, 2:51pm UTC](https://forum.liquibase.org/t/liquibase-failed-to-update-mongodb/6023 "2021-10-14T14:51:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stefano](https://avatars.discourse-cdn.com/v4/letter/s/aca169/32.png) [@Stefano](https://forum.liquibase.org/u/Stefano)\
**Post date:** [October 14, 2021, 2:51pm UTC](https://forum.liquibase.org/t/liquibase-failed-to-update-mongodb/6023/1 "2021-10-14T14:51:24Z")

</div>

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!

 ![Screenshot 2021-10-14 at 16.52.37 (2)](https://us1.discourse-cdn.com/flex020/uploads/liquibase1/original/1X/6dcc8540379ce444c99f4c685a6c148b089b8d1f.jpeg)  
 ![Screenshot 2021-10-14 at 16.52.41 (2)](https://us1.discourse-cdn.com/flex020/uploads/liquibase1/original/1X/e26062e9f6f4ad9b30d30822a3d01f4b03b51a0a.jpeg)

---

<div class="post-metadata">

**Author:** ![MikeOlivas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/mikeolivas/32/183_2.png) [@MikeOlivas](https://forum.liquibase.org/u/MikeOlivas)\
**Post date:** [October 21, 2021, 4:49pm UTC](https://forum.liquibase.org/t/liquibase-failed-to-update-mongodb/6023/2 "2021-10-21T16:49:24Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![aditi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/aditi/32/356_2.png) [@aditi](https://forum.liquibase.org/u/aditi)\
**Post date:** [October 21, 2021, 4:52pm UTC](https://forum.liquibase.org/t/liquibase-failed-to-update-mongodb/6023/3 "2021-10-21T16:52:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MikeOlivas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.liquibase.org/mikeolivas/32/183_2.png) [@MikeOlivas](https://forum.liquibase.org/u/MikeOlivas)\
**Post date:** [October 21, 2021, 5:08pm UTC](https://forum.liquibase.org/t/liquibase-failed-to-update-mongodb/6023/4 "2021-10-21T17:08:28Z")

</div>

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?
