I am using Springboot3 with liquibase. Spring is unable to find the changelog file, however it is present and the path is configured correctly
project structure
src/main/java/com/example/io.akash.sharma.liquibase/LiquibaseApplication.java
src/main/resources/application.properties
src/main/resources/db/chnagelog/db.changelog-master.xml
src/main/resources/db/chnagelog/changelog-dml.xml
application.properties
spring.application.name=liquibase-poc
server.port=8083
spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.driver-class-name=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.liquibase.enabled=true
spring.liquibase.change-log=classpath:db/changelog/db.changelog-master.xml
spring.h2.console.enabled=true
spring.jpa.hibernate.ddl-auto=none
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.0.xsd">
<include file="/sql/changelog-dml.xml" />
</databaseChangeLog>
I am getting below error. Everything looks right, please can you help me identify my mistake.
I have the changelog in the correct directory.
Logs below
"C:Program FilesJavaopenjdk17.0.9binjava.exe" -XX:TieredStopAtLevel=1 -Dspring.profiles.active=liquibase -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true "-Dmanagement.endpoints.jmx.exposure.include=*" "-javaagent:C:Program FilesJetBrainsIntelliJ IDEA 2022.3.1libidea_rt.jar=62652:C:Program FilesJetBrainsIntelliJ IDEA 2022.3.1bin" -Dfile.encoding=UTF-8 -classpath C:UserssharakafdbMacsalertCODEliquibase-pocliquibase-poctargetclasses;C:Userssharakaf.m2repositoryorgliquibaseliquibase-core4.27.0liquibase-core-4.27.0.jar;C:Userssharakaf.m2repositorycomopencsvopencsv5.9opencsv-5.9.jar;C:Userssharakaf.m2repositoryorgapachecommonscommons-text1.11.0commons-text-1.11.0.jar;C:Userssharakaf.m2repositoryorgapachecommonscommons-collections44.4commons-collections4-4.4.jar;C:Userssharakaf.m2repositoryorgyamlsnakeyaml2.2snakeyaml-2.2.jar;C:Userssharakaf.m2repositoryjavaxxmlbindjaxb-api2.3.1jaxb-api-2.3.1.jar;C:Userssharakaf.m2repositoryorgapachecommonscommons-lang33.14.0commons-lang3-3.14.0.jar;C:Userssharakaf.m2repositorycomdbrcacommonsrca-liquibase1.0.25rca-liquibase-1.0.25.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot-starter-actuator3.3.0spring-boot-starter-actuator-3.3.0.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot-actuator-autoconfigure3.3.0spring-boot-actuator-autoconfigure-3.3.0.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot-actuator3.3.0spring-boot-actuator-3.3.0.jar;C:Userssharakaf.m2repositoryiomicrometermicrometer-observation1.13.0micrometer-observation-1.13.0.jar;C:Userssharakaf.m2repositoryiomicrometermicrometer-commons1.13.0micrometer-commons-1.13.0.jar;C:Userssharakaf.m2repositoryiomicrometermicrometer-jakarta91.13.0micrometer-jakarta9-1.13.0.jar;C:Userssharakaf.m2repositoryiomicrometermicrometer-core1.13.0micrometer-core-1.13.0.jar;C:Userssharakaf.m2repositoryorghdrhistogramHdrHistogram2.2.1HdrHistogram-2.2.1.jar;C:Userssharakaf.m2repositoryorglatencyutilsLatencyUtils2.0.3LatencyUtils-2.0.3.jar;C:Userssharakaf.m2repositoryorgslf4jlog4j-over-slf4j2.0.13log4j-over-slf4j-2.0.13.jar;C:Userssharakaf.m2repositoryorgslf4jslf4j-api2.0.13slf4j-api-2.0.13.jar;C:Userssharakaf.m2repositorycomoracleojdbc712.1.0.2.0ojdbc7-12.1.0.2.0.jar;C:Userssharakaf.m2repositorycomh2databaseh22.2.224h2-2.2.224.jar;C:Userssharakaf.m2repositoryorgpostgresqlpostgresql42.7.3postgresql-42.7.3.jar;C:Userssharakaf.m2repositoryorgcheckerframeworkchecker-qual3.42.0checker-qual-3.42.0.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot-starter-web3.3.0spring-boot-starter-web-3.3.0.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot-starter3.3.0spring-boot-starter-3.3.0.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot3.3.0spring-boot-3.3.0.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot-autoconfigure3.3.0spring-boot-autoconfigure-3.3.0.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot-starter-logging3.3.0spring-boot-starter-logging-3.3.0.jar;C:Userssharakaf.m2repositorychqoslogbacklogback-classic1.5.6logback-classic-1.5.6.jar;C:Userssharakaf.m2repositorychqoslogbacklogback-core1.5.6logback-core-1.5.6.jar;C:Userssharakaf.m2repositoryorgapachelogginglog4jlog4j-to-slf4j2.23.1log4j-to-slf4j-2.23.1.jar;C:Userssharakaf.m2repositoryorgapachelogginglog4jlog4j-api2.23.1log4j-api-2.23.1.jar;C:Userssharakaf.m2repositoryorgslf4jjul-to-slf4j2.0.13jul-to-slf4j-2.0.13.jar;C:Userssharakaf.m2repositoryjakartaannotationjakarta.annotation-api2.1.1jakarta.annotation-api-2.1.1.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot-starter-json3.3.0spring-boot-starter-json-3.3.0.jar;C:Userssharakaf.m2repositorycomfasterxmljacksoncorejackson-databind2.17.1jackson-databind-2.17.1.jar;C:Userssharakaf.m2repositorycomfasterxmljacksoncorejackson-annotations2.17.1jackson-annotations-2.17.1.jar;C:Userssharakaf.m2repositorycomfasterxmljacksoncorejackson-core2.17.1jackson-core-2.17.1.jar;C:Userssharakaf.m2repositorycomfasterxmljacksondatatypejackson-datatype-jdk82.17.1jackson-datatype-jdk8-2.17.1.jar;C:Userssharakaf.m2repositorycomfasterxmljacksondatatypejackson-datatype-jsr3102.17.1jackson-datatype-jsr310-2.17.1.jar;C:Userssharakaf.m2repositorycomfasterxmljacksonmodulejackson-module-parameter-names2.17.1jackson-module-parameter-names-2.17.1.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot-starter-tomcat3.3.0spring-boot-starter-tomcat-3.3.0.jar;C:Userssharakaf.m2repositoryorgapachetomcatembedtomcat-embed-core10.1.24tomcat-embed-core-10.1.24.jar;C:Userssharakaf.m2repositoryorgapachetomcatembedtomcat-embed-el10.1.24tomcat-embed-el-10.1.24.jar;C:Userssharakaf.m2repositoryorgapachetomcatembedtomcat-embed-websocket10.1.24tomcat-embed-websocket-10.1.24.jar;C:Userssharakaf.m2repositoryorgspringframeworkspring-web6.1.8spring-web-6.1.8.jar;C:Userssharakaf.m2repositoryorgspringframeworkspring-beans6.1.8spring-beans-6.1.8.jar;C:Userssharakaf.m2repositoryorgspringframeworkspring-webmvc6.1.8spring-webmvc-6.1.8.jar;C:Userssharakaf.m2repositoryorgspringframeworkspring-aop6.1.8spring-aop-6.1.8.jar;C:Userssharakaf.m2repositoryorgspringframeworkspring-context6.1.8spring-context-6.1.8.jar;C:Userssharakaf.m2repositoryorgspringframeworkspring-expression6.1.8spring-expression-6.1.8.jar;C:Userssharakaf.m2repositoryorgspringframeworkspring-core6.1.8spring-core-6.1.8.jar;C:Userssharakaf.m2repositoryorgspringframeworkspring-jcl6.1.8spring-jcl-6.1.8.jar;C:Userssharakaf.m2repositoryorgmybatisspringbootmybatis-spring-boot-starter2.1.4mybatis-spring-boot-starter-2.1.4.jar;C:Userssharakaf.m2repositoryorgmybatisspringbootmybatis-spring-boot-autoconfigure2.1.4mybatis-spring-boot-autoconfigure-2.1.4.jar;C:Userssharakaf.m2repositoryorgmybatismybatis3.5.6mybatis-3.5.6.jar;C:Userssharakaf.m2repositoryorgmybatismybatis-spring2.0.6mybatis-spring-2.0.6.jar;C:Userssharakaf.m2repositoryorgspringframeworkbootspring-boot-starter-jdbc3.3.0spring-boot-starter-jdbc-3.3.0.jar;C:Userssharakaf.m2repositorycomzaxxerHikariCP5.1.0HikariCP-5.1.0.jar;C:Userssharakaf.m2repositoryorgspringframeworkspring-jdbc6.1.8spring-jdbc-6.1.8.jar;C:Userssharakaf.m2repositoryorgspringframeworkspring-tx6.1.8spring-tx-6.1.8.jar;C:Userssharakaf.m2repositorycomoracledatabasejdbcojdbc819.21.0.0ojdbc8-19.21.0.0.jar io.sharma.akash.liquibase_poc.LiquibasePocApplication --env.liquibase.flag=enable_liquibase
. ____ _ __ _ _
/\ / ___'_ __ _ _(_)_ __ __ _
( ( )___ | '_ | '_| | '_ / _` |
\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |___, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v3.3.0)
2024-07-10T15:33:41.437+05:30 INFO 36080 --- [liquibase-poc] [ main] i.s.a.l.LiquibasePocApplication : Starting LiquibasePocApplication using Java 17.0.9 with PID 36080 (C:UserssharakafdbMacsalertCODEliquibase-pocliquibase-poctargetclasses started by sharakaf in C:UserssharakafdbMacsalertCODEliquibase-pocliquibase-poc)
2024-07-10T15:33:41.440+05:30 INFO 36080 --- [liquibase-poc] [ main] i.s.a.l.LiquibasePocApplication : The following 1 profile is active: "liquibase"
2024-07-10T15:33:42.401+05:30 INFO 36080 --- [liquibase-poc] [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port 8083 (http)
2024-07-10T15:33:42.408+05:30 INFO 36080 --- [liquibase-poc] [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2024-07-10T15:33:42.409+05:30 INFO 36080 --- [liquibase-poc] [ main] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.24]
2024-07-10T15:33:42.451+05:30 INFO 36080 --- [liquibase-poc] [ main] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2024-07-10T15:33:42.451+05:30 INFO 36080 --- [liquibase-poc] [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 968 ms
2024-07-10T15:33:42.519+05:30 INFO 36080 --- [liquibase-poc] [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...
2024-07-10T15:33:42.668+05:30 INFO 36080 --- [liquibase-poc] [ main] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Added connection conn0: url=jdbc:h2:mem:testdb user=SA
2024-07-10T15:33:42.669+05:30 INFO 36080 --- [liquibase-poc] [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.
2024-07-10T15:33:42.680+05:30 INFO 36080 --- [liquibase-poc] [ main] o.s.b.a.h2.H2ConsoleAutoConfiguration : H2 console available at '/h2-console'. Database available at 'jdbc:h2:mem:testdb'
2024-07-10T15:33:43.129+05:30 INFO 36080 --- [liquibase-poc] [ main] liquibase.database : Set default schema name to PUBLIC
2024-07-10T15:33:43.282+05:30 INFO 36080 --- [liquibase-poc] [ main] liquibase.command : Logging exception.
2024-07-10T15:33:43.282+05:30 INFO 36080 --- [liquibase-poc] [ main] liquibase.ui : ERROR: Exception Details
2024-07-10T15:33:43.282+05:30 INFO 36080 --- [liquibase-poc] [ main] liquibase.ui : ERROR: Exception Primary Class: ChangeLogParseException
2024-07-10T15:33:43.282+05:30 INFO 36080 --- [liquibase-poc] [ main] liquibase.ui : ERROR: Exception Primary Reason: ERROR: The file 'classpath:db/changelog/db.changelog-master.xml' was not found.
The file property cannot be configured with a fully qualified path, but must be a relative path on the property,
and any local or remote base of the path set on the search path.
2024-07-10T15:33:43.282+05:30 INFO 36080 --- [liquibase-poc] [ main] liquibase.ui : ERROR: Exception Primary Source: 4.27.0
2024-07-10T15:33:43.283+05:30 INFO 36080 --- [liquibase-poc] [ main] liquibase.command : Command execution complete
2024-07-10T15:33:43.284+05:30 WARN 36080 --- [liquibase-poc] [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: liquibase.exception.CommandExecutionException: liquibase.exception.ChangeLogParseException: ERROR: The file 'classpath:db/changelog/db.changelog-master.xml' was not found.
The file property cannot be configured with a fully qualified path, but must be a relative path on the property,
and any local or remote base of the path set on the search path.
2024-07-10T15:33:43.285+05:30 INFO 36080 --- [liquibase-poc] [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2024-07-10T15:33:43.287+05:30 INFO 36080 --- [liquibase-poc] [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
2024-07-10T15:33:43.289+05:30 INFO 36080 --- [liquibase-poc] [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2024-07-10T15:33:43.299+05:30 INFO 36080 --- [liquibase-poc] [ main] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-07-10T15:33:43.319+05:30 ERROR 36080 --- [liquibase-poc] [ 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]: liquibase.exception.CommandExecutionException: liquibase.exception.ChangeLogParseException: ERROR: The file 'classpath:db/changelog/db.changelog-master.xml' was not found.
The file property cannot be configured with a fully qualified path, but must be a relative path on the property,
and any local or remote base of the path set on the search path.
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1788) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:337) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:335) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:962) ~[spring-context-6.1.8.jar:6.1.8]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624) ~[spring-context-6.1.8.jar:6.1.8]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:335) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363) ~[spring-boot-3.3.0.jar:3.3.0]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352) ~[spring-boot-3.3.0.jar:3.3.0]
at io.sharma.akash.liquibase_poc.LiquibasePocApplication.main(LiquibasePocApplication.java:11) ~[classes/:na]
Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CommandExecutionException: liquibase.exception.ChangeLogParseException: ERROR: The file 'classpath:db/changelog/db.changelog-master.xml' was not found.
The file property cannot be configured with a fully qualified path, but must be a relative path on the property,
and any local or remote base of the path set on the search path.
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:259) ~[liquibase-core-4.27.0.jar:na]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1835) ~[spring-beans-6.1.8.jar:6.1.8]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1784) ~[spring-beans-6.1.8.jar:6.1.8]
... 16 common frames omitted
Caused by: liquibase.exception.CommandExecutionException: liquibase.exception.ChangeLogParseException: ERROR: The file 'classpath:db/changelog/db.changelog-master.xml' was not found.
The file property cannot be configured with a fully qualified path, but must be a relative path on the property,
and any local or remote base of the path set on the search path.
at liquibase.command.CommandScope.execute(CommandScope.java:257) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Liquibase.lambda$update$0(Liquibase.java:245) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.lambda$child$0(Scope.java:190) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.child(Scope.java:199) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.child(Scope.java:189) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.child(Scope.java:168) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Liquibase.runInScope(Liquibase.java:1436) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Liquibase.update(Liquibase.java:234) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Liquibase.update(Liquibase.java:212) ~[liquibase-core-4.27.0.jar:na]
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:297) ~[liquibase-core-4.27.0.jar:na]
at liquibase.integration.spring.SpringLiquibase.lambda$afterPropertiesSet$0(SpringLiquibase.java:249) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.lambda$child$0(Scope.java:190) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.child(Scope.java:199) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.child(Scope.java:189) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.child(Scope.java:168) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.child(Scope.java:256) ~[liquibase-core-4.27.0.jar:na]
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:242) ~[liquibase-core-4.27.0.jar:na]
... 18 common frames omitted
Caused by: liquibase.exception.ChangeLogParseException: ERROR: The file 'classpath:db/changelog/db.changelog-master.xml' was not found.
The file property cannot be configured with a fully qualified path, but must be a relative path on the property,
and any local or remote base of the path set on the search path.
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:114) ~[liquibase-core-4.27.0.jar:na]
at liquibase.parser.core.xml.AbstractChangeLogParser.parse(AbstractChangeLogParser.java:15) ~[liquibase-core-4.27.0.jar:na]
at liquibase.command.core.helpers.DatabaseChangelogCommandStep.lambda$getDatabaseChangeLog$0(DatabaseChangelogCommandStep.java:129) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.child(Scope.java:199) ~[liquibase-core-4.27.0.jar:na]
at liquibase.Scope.child(Scope.java:175) ~[liquibase-core-4.27.0.jar:na]
at liquibase.command.core.helpers.DatabaseChangelogCommandStep.getDatabaseChangeLog(DatabaseChangelogCommandStep.java:128) ~[liquibase-core-4.27.0.jar:na]
at liquibase.command.core.helpers.DatabaseChangelogCommandStep.run(DatabaseChangelogCommandStep.java:87) ~[liquibase-core-4.27.0.jar:na]
at liquibase.command.CommandScope.execute(CommandScope.java:219) ~[liquibase-core-4.27.0.jar:na]
... 34 common frames omitted
Process finished with exit code 1