java.lang.NullPointerException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • From http://forum.liquibase.org/topic/liquibase-3-0-2-nullpointerexception-and-logging-request I'm converting an existing set of changeset files over to use liquibase 3.0.2 from version 2.0.0. I've updated the schema versions, but when running one of my changesets now, I'm receiving the following NPE: ... DEBUG 7/23/13 3:18 PM:liquibase: Executing UPDATE database command: UPDATE ntdm.databasechangelogloc k SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1 INFO 7/23/13 3:18 PM:liquibase: Successfully released change log lock Liquibase update Failed: Unknown Reason SEVERE 7/23/13 3:18 PM:liquibase: Unknown Reason java.lang.NullPointerException at liquibase.precondition.core.ChangeSetExecutedPrecondition.check(ChangeSetExecutedPrecondi tion.java:52) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.java:34) at liquibase.precondition.core.PreconditionContainer.check(PreconditionContainer.java:199) at liquibase.changelog.visitor.ValidatingVisitor.validate(ValidatingVisitor.java:52) at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:143) at liquibase.Liquibase.update(Liquibase.java:132) at liquibase.integration.commandline.Main.doMigration(Main.java:848) at liquibase.integration.commandline.Main.main(Main.java:138) The lock is released correctly in the databasechangeloglock table. This is on Postgres 9.2. All changesets previously ran correctly under 2.0 (no changes to content, except for the schema version).
    via by Nathan Voxland,
  • From http://forum.liquibase.org/topic/liquibase-3-0-2-nullpointerexception-and-logging-request I'm converting an existing set of changeset files over to use liquibase 3.0.2 from version 2.0.0. I've updated the schema versions, but when running one of my changesets now, I'm receiving the following NPE: ... DEBUG 7/23/13 3:18 PM:liquibase: Executing UPDATE database command: UPDATE ntdm.databasechangelogloc k SET LOCKED = FALSE, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1 INFO 7/23/13 3:18 PM:liquibase: Successfully released change log lock Liquibase update Failed: Unknown Reason SEVERE 7/23/13 3:18 PM:liquibase: Unknown Reason java.lang.NullPointerException at liquibase.precondition.core.ChangeSetExecutedPrecondition.check(ChangeSetExecutedPrecondi tion.java:52) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.java:34) at liquibase.precondition.core.PreconditionContainer.check(PreconditionContainer.java:199) at liquibase.changelog.visitor.ValidatingVisitor.validate(ValidatingVisitor.java:52) at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:143) at liquibase.Liquibase.update(Liquibase.java:132) at liquibase.integration.commandline.Main.doMigration(Main.java:848) at liquibase.integration.commandline.Main.main(Main.java:138) The lock is released correctly in the databasechangeloglock table. This is on Postgres 9.2. All changesets previously ran correctly under 2.0 (no changes to content, except for the schema version).
    via by Nathan Voxland,
  • http://forum.liquibase.org/topic/null-pointer-exception-in-jdbcdatabasesnapshotgenerator#49382000000211045 I am having a small issue with the hibernate integration. I noticed that you split the hibernate aspect of liquibase into separate extension jar file in v2. I guess the documentation is a little out of date. Anyway having downloaded that, I now get a little further. The output I now get is D:\apps\liquibase-2.0.1-bin>java -jar liquibase.jar --logLevel=debug diff DEBUG 14/02/11 12:46:liquibase: Unable to load/access Apache Derby driver class org.apache.derby.tools.sysinfo to check version: org.apache.derby.tools.sysinfo DEBUG 14/02/11 12:46:liquibase: Connected to XTS_CHRIS@jdbc:oracle:thin:@asus4:1 521:XE WARNING 14/02/11 12:46:liquibase: Unknown database: Hibernate DEBUG 14/02/11 12:46:liquibase: Reading tables for unsupported Database ... INFO 14/02/11 12:46:liquibase: Reading tables for unsupported Database ... Liquibase Update Failed: Unknown Reason SEVERE 14/02/11 12:46:liquibase: Unknown Reason java.lang.NullPointerException at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.readTables(JdbcD atabaseSnapshotGenerator.java:268) at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(J dbcDatabaseSnapshotGenerator.java:240) at liquibase.snapshot.DatabaseSnapshotGeneratorFactory.createSnapshot(Da tabaseSnapshotGeneratorFactory.java:69) at liquibase.diff.Diff.compare(Diff.java:63) at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLine Utils.java:118) at liquibase.integration.commandline.Main.doMigration(Main.java:618) at liquibase.integration.commandline.Main.main(Main.java:116) Looking into the source code, I am a little confused. liquibase.ext.hibernate.database.HibernateDatabase.getConnection always returns null. liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot obtains a DatabaseMetaData and then passes to readTables. My take on the getMetaData method is that it will always return null, hence fail for a hibernate driver. So it appears to me that something must have changed in this area, or I am doing something wrong.
    via by Nathan Voxland,
  • Liquibase Hibernate Plugin Does Not Work
    via Stack Overflow by Jazzepi
    ,
  • GitHub comment 37#35056803
    via GitHub by nicwillemse
    ,
  • GitHub comment 37#35058408
    via GitHub by nicwillemse
    ,
  • from http://forum.liquibase.org/topic/null-pointer-exception-in-jdbcdatabasesnapshotgenerator I am having a small issue with the hibernate integration. I noticed that you split the hibernate aspect of liquibase into separate extension jar file in v2. I guess the documentation is a little out of date. Anyway having downloaded that, I now get a little further. The output I now get is D:\apps\liquibase-2.0.1-bin>java -jar liquibase.jar --logLevel=debug diff DEBUG 14/02/11 12:46:liquibase: Unable to load/access Apache Derby driver class org.apache.derby.tools.sysinfo to check version: org.apache.derby.tools.sysinfo DEBUG 14/02/11 12:46:liquibase: Connected to XTS_CHRIS@jdbc:oracle:thin:@asus4:1 521:XE WARNING 14/02/11 12:46:liquibase: Unknown database: Hibernate DEBUG 14/02/11 12:46:liquibase: Reading tables for unsupported Database ... INFO 14/02/11 12:46:liquibase: Reading tables for unsupported Database ... Liquibase Update Failed: Unknown Reason SEVERE 14/02/11 12:46:liquibase: Unknown Reason java.lang.NullPointerException at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.readTables(JdbcD atabaseSnapshotGenerator.java:268) at liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot(J dbcDatabaseSnapshotGenerator.java:240) at liquibase.snapshot.DatabaseSnapshotGeneratorFactory.createSnapshot(Da tabaseSnapshotGeneratorFactory.java:69) at liquibase.diff.Diff.compare(Diff.java:63) at liquibase.integration.commandline.CommandLineUtils.doDiff(CommandLine Utils.java:118) at liquibase.integration.commandline.Main.doMigration(Main.java:618) at liquibase.integration.commandline.Main.main(Main.java:116) Looking into the source code, I am a little confused. liquibase.ext.hibernate.database.HibernateDatabase.getConnection always returns null. liquibase.snapshot.jvm.JdbcDatabaseSnapshotGenerator.createSnapshot obtains a DatabaseMetaData and then passes to readTables. My take on the getMetaData method is that it will always return null, hence fail for a hibernate driver. So it appears to me that something must have changed in this area, or I am doing something wrong.
    via by Nathan Voxland,
    • java.lang.NullPointerException at liquibase.precondition.core.ChangeSetExecutedPrecondition.check(ChangeSetExecutedPrecondition.java:52) at liquibase.precondition.core.AndPrecondition.check(AndPrecondition.java:34) at liquibase.precondition.core.PreconditionContainer.check(PreconditionContainer.java:199) at liquibase.changelog.visitor.ValidatingVisitor.validate(ValidatingVisitor.java:52) at liquibase.changelog.DatabaseChangeLog.validate(DatabaseChangeLog.java:143) at liquibase.Liquibase.update(Liquibase.java:132) at liquibase.integration.commandline.Main.doMigration(Main.java:848) at liquibase.integration.commandline.Main.main(Main.java:138)
    No Bugmate found.