Without a specified classpath, using includeAll with relativeToChangelogFile="true" fails
Description
Environment
Running liquibase 3.5.1 from command line on MacOS
Activity
Show:

Robert Bor November 22, 2016 at 5:55 AM
Please note that the 3.5.2 release still appears not to have a functioning includeAll: http://stackoverflow.com/questions/40729071/executable-jar-unable-to-find-liquibase-db-changelog-xml#answer-40731113

DS September 7, 2016 at 8:49 PM
Thanks Nathan. Looking forward to the 3.5.2 release.
Nathan Voxland September 2, 2016 at 8:48 PM
This should be fixed with https://liquibase.jira.com/browse/CORE-2756#icft=CORE-2756
Fixed
Details
Details
Created August 25, 2016 at 10:30 PM
Updated November 22, 2016 at 6:45 PM
Resolved September 2, 2016 at 8:48 PM
I am running liquibase update from the command line without specifying a classpath. My master changelog file uses includeAll with relativeToChangelogFile="true". The result is a NullPointerException at FileSystemResourceAccessor.convertToPath().
Here are the details:
$ tree . ├── liquibase │ ├── lib │ │ ├── mysql-connector-java-5.0.8-bin.jar │ │ └── snakeyaml-1.13.jar │ ├── liquibase │ ├── liquibase.bat │ ├── liquibase.jar │ ├── liquibase.properties └── resources ├── changelogs │ ├── db.changelog-10.121.0.xml │ ├── db.changelog-10.121.1.yaml │ └── db.changelog-10.122.0.xml ├── db.changelog-master.xml $ cat liquibase.properties url=jdbc:mysql://127.0.0.1:3306/test username=foo password=bar driver=com.mysql.jdbc.Driver changeLogFile=/Users/dsiegal/Sandbox/tbbportal/liferay/db-change-management/resources/db.changelog-master.xml logLevel=debug $ cat /Users/dsiegal/Sandbox/tbbportal/liferay/db-change-management/resources/db.changelog-master.xml <?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.5.xsd"> <includeAll path="changelogs" errorIfMissingOrEmpty="true" relativeToChangelogFile="true"/> </databaseChangeLog> $ ./liquibase update DEBUG 8/25/16 3:15 PM: liquibase: Connected to foo@localhost@jdbc:mysql://127.0.0.1:3306/test DEBUG 8/25/16 3:15 PM: liquibase: Setting auto commit to false from true DEBUG 8/25/16 3:15 PM: liquibase: Executing QUERY database command: select count(*) from test.DATABASECHANGELOGLOCK DEBUG 8/25/16 3:15 PM: liquibase: Executing QUERY database command: select count(*) from test.DATABASECHANGELOGLOCK DEBUG 8/25/16 3:15 PM: liquibase: Executing QUERY database command: SELECT LOCKED FROM test.DATABASECHANGELOGLOCK WHERE ID=1 DEBUG 8/25/16 3:15 PM: liquibase: Lock Database DEBUG 8/25/16 3:15 PM: liquibase: Executing UPDATE database command: UPDATE test.DATABASECHANGELOGLOCK SET LOCKED = 1, LOCKEDBY = '10.253.93.241 (10.253.93.241)', LOCKGRANTED = '2016-08-25 15:15:31.756' WHERE ID = 1 AND LOCKED = 0 INFO 8/25/16 3:15 PM: liquibase: Successfully acquired change log lock DEBUG 8/25/16 3:15 PM: liquibase: Resolving XML entity name='null', publicId='null', baseURI='null', systemId='http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.5.xsd' DEBUG 8/25/16 3:15 PM: liquibase: Opening jar:file:/Users/dsiegal/Sandbox/tbbportal/liferay/db-change-management/liquibase/liquibase.jar!/liquibase/parser/core/xml/dbchangelog-3.5.xsd as liquibase/parser/core/xml/dbchangelog-3.5.xsd DEBUG 8/25/16 3:15 PM: liquibase: includeAll for changelogs/ DEBUG 8/25/16 3:15 PM: liquibase: Using file opener for includeAll: liquibase.resource.CompositeResourceAccessor(liquibase.resource.FileSystemResourceAccessor(/Users/dsiegal/Sandbox/tbbportal/liferay/db-change-management/liquibase/.),liquibase.integration.commandline.CommandLineResourceAccessor()) DEBUG 8/25/16 3:15 PM: liquibase: Release Database Lock DEBUG 8/25/16 3:15 PM: liquibase: Executing UPDATE database command: UPDATE test.DATABASECHANGELOGLOCK SET LOCKED = 0, LOCKEDBY = NULL, LOCKGRANTED = NULL WHERE ID = 1 INFO 8/25/16 3:15 PM: liquibase: Successfully released change log lock Unexpected error running Liquibase: Unknown Reason SEVERE 8/25/16 3:15 PM: liquibase: Unknown Reason liquibase.exception.ChangeLogParseException: liquibase.exception.SetupException at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:27) at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:229) at liquibase.Liquibase.update(Liquibase.java:202) at liquibase.Liquibase.update(Liquibase.java:192) at liquibase.integration.commandline.Main.doMigration(Main.java:1126) at liquibase.integration.commandline.Main.run(Main.java:184) at liquibase.integration.commandline.Main.main(Main.java:103) Caused by: liquibase.exception.SetupException at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:445) at liquibase.changelog.DatabaseChangeLog.handleChildNode(DatabaseChangeLog.java:349) at liquibase.changelog.DatabaseChangeLog.load(DatabaseChangeLog.java:282) at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:25) ... 6 more Caused by: java.lang.NullPointerException at liquibase.resource.FileSystemResourceAccessor.convertToPath(FileSystemResourceAccessor.java:99) at liquibase.resource.AbstractResourceAccessor.getContents(AbstractResourceAccessor.java:90) at liquibase.resource.FileSystemResourceAccessor.list(FileSystemResourceAccessor.java:86) at liquibase.resource.CompositeResourceAccessor.list(CompositeResourceAccessor.java:40) at liquibase.changelog.DatabaseChangeLog.includeAll(DatabaseChangeLog.java:422) ... 9 more