liquibase.exception.DatabaseException: 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.

  • When trying to add a tag to a database with several rows in the database changelog table the following stacktrace is returned: [echo] Adding tag before-3.16.8 [tagDatabase] INFO 6/25/14 8:34 AM: liquibase: Successfully acquired change log lock [tagDatabase] INFO 6/25/14 8:35 AM: liquibase: Successfully released change log lock BUILD FAILED /home/developer/database.ent:30: liquibase.exception.DatabaseException: java.lang.NullPointerException at liquibase.changelog.StandardChangeLogHistoryService.tag(StandardChangeLogHistoryService.java:306) at liquibase.database.AbstractJdbcDatabase.tag(AbstractJdbcDatabase.java:834) at liquibase.Liquibase.tag(Liquibase.java:695) at liquibase.integration.ant.TagDatabaseTask.executeWithLiquibaseClassloader(TagDatabaseTask.java:32) at liquibase.integration.ant.BaseLiquibaseTask.execute(BaseLiquibaseTask.java:75) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:809) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: java.lang.NullPointerException at liquibase.changelog.StandardChangeLogHistoryService.tag(StandardChangeLogHistoryService.java:304) ... 20 more The tag is added with the ant task tagdatabase before any new changesets are applied.
    via by Per Östgärd,
  • When trying to add a tag to a database with several rows in the database changelog table the following stacktrace is returned: [echo] Adding tag before-3.16.8 [tagDatabase] INFO 6/25/14 8:34 AM: liquibase: Successfully acquired change log lock [tagDatabase] INFO 6/25/14 8:35 AM: liquibase: Successfully released change log lock BUILD FAILED /home/developer/database.ent:30: liquibase.exception.DatabaseException: java.lang.NullPointerException at liquibase.changelog.StandardChangeLogHistoryService.tag(StandardChangeLogHistoryService.java:306) at liquibase.database.AbstractJdbcDatabase.tag(AbstractJdbcDatabase.java:834) at liquibase.Liquibase.tag(Liquibase.java:695) at liquibase.integration.ant.TagDatabaseTask.executeWithLiquibaseClassloader(TagDatabaseTask.java:32) at liquibase.integration.ant.BaseLiquibaseTask.execute(BaseLiquibaseTask.java:75) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:809) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: java.lang.NullPointerException at liquibase.changelog.StandardChangeLogHistoryService.tag(StandardChangeLogHistoryService.java:304) ... 20 more The tag is added with the ant task tagdatabase before any new changesets are applied.
    via by Per Östgärd,
  • I wanted to use the liquibase tag functionality. At first, I run the following command into cmd (with liquibase.properties set up etc) liquibase --changeLogFile=changeLog.xml update where the changeLog.xml contains as follows: <?xml version="1.0" encoding="UTF-8"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> <changeSet id="1" author="ivan"> <createTable tableName="customer"> <column name="id" type="varchar2(42)" /> <column name="name" type="varchar2(42)" /> </createTable> </changeSet> </databaseChangeLog> and no error occurs. Now, I want to tag the current database state, by using the following command: liquibase --changeLogFile=changeLog.xml tag exampletag and I've also tried using the following command liquibase tag exampletag alas, both attempts failed with the same error message, as follows Unexpected error running Liquibase: Unknown Reason How do I properly tag a database in the current state, by passing the commands via command line? Thanks! **UPDATE** This is the stack trace I obtained from running the first command. And also, I am using Liquibase 3.2.0 DEBUG 6/11/14 2:42 PM: liquibase: Connected to N603066@jdbc:oracle:thin:@10.111.48.125:1521:orcl DEBUG 6/11/14 2:42 PM: liquibase: Setting auto commit to false from true DEBUG 6/11/14 2:42 PM: liquibase: Computed checksum for 1402468965639 as 984dfd7dd9a2496bb4b3c74eeafa6a64 DEBUG 6/11/14 2:42 PM: liquibase: Executing QUERY database command: select count(*) from N603066.DATABASECHANGELOGLOCK DEBUG 6/11/14 2:42 PM: liquibase: Executing QUERY database command: SELECT LOCKED FROM N603066.DATABASECHANGELOGLOCK WHERE ID=1 FOR UPDATE DEBUG 6/11/14 2:42 PM: liquibase: Lock Database DEBUG 6/11/14 2:42 PM: liquibase: Executing UPDATE database command: UPDATE N603066.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = 'LD418102Y (10.111.48.204)', LOCKGRANTED = to_date('2014-06-11 14:42:45', 'YYYY-MM-DD HH24:MI:SS') WHERE ID = 1 AND LOCKED = 0 INFO 6/11/14 2:42 PM: liquibase: Successfully acquired change log lock DEBUG 6/11/14 2:42 PM: liquibase: Executing QUERY database command: SELECT MD5SUM FROM N603066.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL DEBUG 6/11/14 2:42 PM: liquibase: Executing QUERY database command: select count(*) from N603066.DATABASECHANGELOGLOCK DEBUG 6/11/14 2:42 PM: liquibase: Executing QUERY database command: SELECT COUNT(*) FROM N603066.DATABASECHANGELOG DEBUG 6/11/14 2:42 PM: liquibase: Executing EXECUTE database command: UPDATE N603066.DATABASECHANGELOG SET TAG = 'exampletag' WHERE DATEEXECUTED = (SELECT MAX(DATEEXECUTED) FROM N603066.DATABASECHANGELOG) DEBUG 6/11/14 2:42 PM: liquibase: Release Database Lock DEBUG 6/11/14 2:42 PM: liquibase: Executing UPDATE database command: UPDATE N603066.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1 INFO 6/11/14 2:42 PM: liquibase: Successfully released change log lock Unexpected error running Liquibase: Unknown Reason SEVERE 6/11/14 2:42 PM: liquibase: Unknown Reason liquibase.exception.DatabaseException: java.lang.NullPointerException at liquibase.changelog.StandardChangeLogHistoryService.tag(StandardChangeLogHistoryService.java:306) at liquibase.database.AbstractJdbcDatabase.tag(AbstractJdbcDatabase.java:834) at liquibase.Liquibase.tag(Liquibase.java:695) at liquibase.integration.commandline.Main.doMigration(Main.java:939) at liquibase.integration.commandline.Main.run(Main.java:170) at liquibase.integration.commandline.Main.main(Main.java:89) Caused by: java.lang.NullPointerException at liquibase.changelog.StandardChangeLogHistoryService.tag(StandardChangeLogHistoryService.java:304) ... 5 more For more information, use the --logLevel flag
    via by Ivan Wangsa ,
  • I wanted to use the liquibase tag functionality. At first, I run the following command into cmd (with liquibase.properties set up etc) liquibase --changeLogFile=changeLog.xml update where the changeLog.xml contains as follows: <?xml version="1.0" encoding="UTF-8"?> <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> <changeSet id="1" author="ivan"> <createTable tableName="customer"> <column name="id" type="varchar2(42)" /> <column name="name" type="varchar2(42)" /> </createTable> </changeSet> </databaseChangeLog> and no error occurs. Now, I want to tag the current database state, by using the following command: liquibase --changeLogFile=changeLog.xml tag exampletag and I've also tried using the following command liquibase tag exampletag alas, both attempts failed with the same error message, as follows Unexpected error running Liquibase: Unknown Reason How do I properly tag a database in the current state, by passing the commands via command line? Thanks! **UPDATE** This is the stack trace I obtained from running the first command. And also, I am using Liquibase 3.2.0 DEBUG 6/11/14 2:42 PM: liquibase: Connected to N603066@jdbc:oracle:thin:@10.111.48.125:1521:orcl DEBUG 6/11/14 2:42 PM: liquibase: Setting auto commit to false from true DEBUG 6/11/14 2:42 PM: liquibase: Computed checksum for 1402468965639 as 984dfd7dd9a2496bb4b3c74eeafa6a64 DEBUG 6/11/14 2:42 PM: liquibase: Executing QUERY database command: select count(*) from N603066.DATABASECHANGELOGLOCK DEBUG 6/11/14 2:42 PM: liquibase: Executing QUERY database command: SELECT LOCKED FROM N603066.DATABASECHANGELOGLOCK WHERE ID=1 FOR UPDATE DEBUG 6/11/14 2:42 PM: liquibase: Lock Database DEBUG 6/11/14 2:42 PM: liquibase: Executing UPDATE database command: UPDATE N603066.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = 'LD418102Y (10.111.48.204)', LOCKGRANTED = to_date('2014-06-11 14:42:45', 'YYYY-MM-DD HH24:MI:SS') WHERE ID = 1 AND LOCKED = 0 INFO 6/11/14 2:42 PM: liquibase: Successfully acquired change log lock DEBUG 6/11/14 2:42 PM: liquibase: Executing QUERY database command: SELECT MD5SUM FROM N603066.DATABASECHANGELOG WHERE MD5SUM IS NOT NULL DEBUG 6/11/14 2:42 PM: liquibase: Executing QUERY database command: select count(*) from N603066.DATABASECHANGELOGLOCK DEBUG 6/11/14 2:42 PM: liquibase: Executing QUERY database command: SELECT COUNT(*) FROM N603066.DATABASECHANGELOG DEBUG 6/11/14 2:42 PM: liquibase: Executing EXECUTE database command: UPDATE N603066.DATABASECHANGELOG SET TAG = 'exampletag' WHERE DATEEXECUTED = (SELECT MAX(DATEEXECUTED) FROM N603066.DATABASECHANGELOG) DEBUG 6/11/14 2:42 PM: liquibase: Release Database Lock DEBUG 6/11/14 2:42 PM: liquibase: Executing UPDATE database command: UPDATE N603066.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1 INFO 6/11/14 2:42 PM: liquibase: Successfully released change log lock Unexpected error running Liquibase: Unknown Reason SEVERE 6/11/14 2:42 PM: liquibase: Unknown Reason liquibase.exception.DatabaseException: java.lang.NullPointerException at liquibase.changelog.StandardChangeLogHistoryService.tag(StandardChangeLogHistoryService.java:306) at liquibase.database.AbstractJdbcDatabase.tag(AbstractJdbcDatabase.java:834) at liquibase.Liquibase.tag(Liquibase.java:695) at liquibase.integration.commandline.Main.doMigration(Main.java:939) at liquibase.integration.commandline.Main.run(Main.java:170) at liquibase.integration.commandline.Main.main(Main.java:89) Caused by: java.lang.NullPointerException at liquibase.changelog.StandardChangeLogHistoryService.tag(StandardChangeLogHistoryService.java:304) ... 5 more For more information, use the --logLevel flag
    via by Ivan Wangsa ,
    • liquibase.exception.DatabaseException: java.lang.NullPointerException at liquibase.changelog.StandardChangeLogHistoryService.tag(StandardChangeLogHistoryService.java:306) at liquibase.database.AbstractJdbcDatabase.tag(AbstractJdbcDatabase.java:834) at liquibase.Liquibase.tag(Liquibase.java:695) at liquibase.integration.ant.TagDatabaseTask.executeWithLiquibaseClassloader(TagDatabaseTask.java:32) at liquibase.integration.ant.BaseLiquibaseTask.execute(BaseLiquibaseTask.java:75) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:390) at org.apache.tools.ant.Target.performTasks(Target.java:411) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399) at org.apache.tools.ant.Project.executeTarget(Project.java:1368) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:809) at org.apache.tools.ant.Main.startAnt(Main.java:217) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) Caused by: java.lang.NullPointerException at liquibase.changelog.StandardChangeLogHistoryService.tag(StandardChangeLogHistoryService.java:304) ... 20 more
    No Bugmate found.