NullPointerException on RollbackOneChangeSetCommand.getPriority

Hi,

I am discovering Liquibase and trying to set it up on my project, but I can’t get it to run an initial generateChangeLog or snapshot command, as I am getting a NullPointerException.

Here’s some details :

  • liquibase (4.2.2) runs on a Debian 10 Linux on Windows Subsystem for Linux v2.
  • I’m using PostgreSQL 13.1 and have tried on three different servers (all docker containers on the same linux system) with three different databases with only one schema.
  • I tried with adoptOpenJDK 11 (JRE and JDK), and OpenJDK (Oracle) 13

My JAVA_HOME env variable is set to my jdk /bin folder

And here is the end of the stack trace :

...
[2020-12-18 13:15:49] FINE [liquibase.servicelocator] Loaded liquibase.sqlgenerator.SqlGenerator instance com.datical.liquibase.ext.storedlogic.trigger.change.RenameTriggerGenerator
[2020-12-18 13:15:49] FINE [liquibase.executor] Executing with the 'jdbc' executor
[2020-12-18 13:15:49] FINE [liquibase.executor] 0 row(s) affected
Unexpected error running Liquibase: Unknown reason
For more information, please use the --logLevel flag
[2020-12-18 13:15:49] SEVERE [liquibase.integration] Unexpected error running Liquibase: Unknown reason
java.lang.NullPointerException
        at com.datical.liquibase.ext.command.RollbackOneChangeSetCommand.getPriority(Unknown Source)
        at liquibase.command.CommandFactory$1.compare(CommandFactory.java:49)
        at liquibase.command.CommandFactory$1.compare(CommandFactory.java:46)
        at java.base/java.util.TimSort.binarySort(TimSort.java:296)
        at java.base/java.util.TimSort.sort(TimSort.java:221)
        at java.base/java.util.Arrays.sort(Arrays.java:1516)
        at java.base/java.util.ArrayList.sort(ArrayList.java:1717)
        at java.base/java.util.Collections.sort(Collections.java:179)
        at liquibase.command.CommandFactory.getCommand(CommandFactory.java:55)
        at liquibase.integration.commandline.CommandLineUtils.doGenerateChangeLog(CommandLineUtils.java:237)
        at liquibase.integration.commandline.Main.doMigration(Main.java:1519)
        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)

here’s my liquibase.properties :

    driver: org.postgresql.Driver
    classpath: /home/setsuna/testLiquibase/postgresql-42.2.18.jar
    url: jdbc:postgresql://localhost:58434/my-database
    username: ---
    password: ---

And finally the command I used :

sudo ~/testLiquibase/OpenJDK-Oracle/jdk-13/bin/java -jar ~/testLiquibase/liquibase/liquibase.jar --defaultsFile=liquibase/liquibase.properties.dev --changeLogFile=testChangelog.postgres.sql --logLevel=debug generateChangeLog

I’ve searched for other topics on the subject and tried several advices from those but nothing worked.

I don’t know what else to try to solve this problem and need the help of people who know liquibase and/or Java better than I do
Thanks

Hi @Ronan,

Could we see the contents of:

You mentioned a liquibase.properties file, did you mean liquibase.properties.dev?

We also need your full log, not just the snippet, it would contain helpful info to diagnose.

Thanks,

Ronak