NullPointerException when tagging through Ant before applying changesets

Description

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.

Environment

Ant 1.8.2
Java version: java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
Default locale: en_US.UTF-8
OS name: "Linux Mint", version: "3.8.0-19-generic"

Activity

Show:

Nathan Voxland July 3, 2014 at 4:21 PM

Same cause as

Per Östgärd June 25, 2014 at 9:00 AM
Edited

After debugging I can see that it is the List StandardChangeLogHistoryService.ranChangeSetList that is set to null when ant is executing the tag(final String tagString)-method.

The NullPointerException occurs when this row is executed: ranChangeSetList.get(ranChangeSetList.size() - 1).setTag(tagString);

Duplicate

Details

Reporter

Components

Fix versions

Affects versions

Priority

Created June 25, 2014 at 8:56 AM
Updated July 3, 2014 at 4:21 PM
Resolved July 3, 2014 at 4:21 PM