We're updating the issue view to help you get more done. 

ChangeLogParseException with Spring Boot

Description

ChangelogParseException during Spring Boot application startup:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 2019-08-11 09:14:00.225 ERROR 3622 --- [ main] o.s.boot.SpringApplication : Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: Error parsing classpath:/db/changelog/db.changelog-master.yaml at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1778) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:307) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1105) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390) at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1214) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1203) at ru.avtoapp.AvtoAppApplication.main(AvtoAppApplication.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:51) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:52) Caused by: liquibase.exception.ChangeLogParseException: Error parsing classpath:/db/changelog/db.changelog-master.yaml at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:83) at liquibase.Liquibase.getDatabaseChangeLog(Liquibase.java:217) at liquibase.Liquibase.update(Liquibase.java:190) at liquibase.Liquibase.update(Liquibase.java:179) at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:366) at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:314) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1837) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1774) ... 26 common frames omitted Caused by: java.io.FileNotFoundException: class path resource [db/changelog/db.changelog-master.yaml] cannot be resolved to URL because it does not exist at org.springframework.core.io.ClassPathResource.getURL(ClassPathResource.java:195) at liquibase.integration.spring.SpringLiquibase$SpringResourceOpener.getResourcesAsStream(SpringLiquibase.java:613) at liquibase.util.StreamUtil.singleInputStream(StreamUtil.java:186) at liquibase.parser.core.yaml.YamlChangeLogParser.parse(YamlChangeLogParser.java:26) ... 33 common frames omitted

I don't have db/changelog/db.changelog-master.yaml, instead I have db/changelog/db.changelog-master.xml file, but Spring Boot wants to parse yaml file exactly.
Seems like the problem is with Spring Boot autoconfiguration LiquibaseProperties class (https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java), namely, line #39:

1 private String changeLog = "classpath:/db/changelog/db.changelog-master.yaml";

Hence, Spring Boot autoconfiguration relies on yaml file and format, unlike that I have liquibase.changelog configuration property set to xml in my application-dev.yaml file:

1 2 liquibase: changeLog: classpath:/db/changelog/db.changelog-master.xml

Please, help. I'll try to cross-post this bug in Spring Boot also.
Thank you.

Environment

Spring version 5.1.9.RELEASE
Spring Boot version 2.1.7.RELEASE
Liquibase version 3.7.0

Status

Assignee

Unassigned

Reporter

Alexander Garncev

Labels

None

Components

Affects versions

3.7.0

Priority

Blocker