Как исправить ошибку liquibase.parser: Error parsing line 1 column 1 of Premature end of file?

В чем может быть причина данной ошибки?

Ошибка вызывается в инфраструктуре Kubernetes который использует докер образы spring boot приложения.
Подключение выполняется к удаленной базе данных.

Что самое интересно кода запускаешь отдельно образ приложения ошибка не возникает.
Так же когда запускаешь в minikube то также ошибка не возникает.
Ранее данная ошибка не возникала в инф. Kubernetes но сейчас начала появляться.

Пример файла classpath:db/changelog/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-4.6.xsd">

    <include file="changeloges/changelog.xml" relativeToChangelogFile="true"/>

</databaseChangeLog>


2023-11-16 14:07:43.138  INFO 1 --- [           main] .m.a.s.r.AttributeServiceRestApplication : The following 1 profile is active: "attribute"
2023-11-16 14:07:44.408  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.
2023-11-16 14:07:44.546  INFO 1 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 128 ms. Found 2 JPA repository interfaces.
2023-11-16 14:07:45.719  INFO 1 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=44ce40b9-29b7-3754-b343-cef16a00db2c
2023-11-16 14:07:46.130  INFO 1 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 5812 (http)
2023-11-16 14:07:46.139  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2023-11-16 14:07:46.139  INFO 1 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.63]
2023-11-16 14:07:46.281  INFO 1 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2023-11-16 14:07:46.281  INFO 1 --- [           main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3066 ms
2023-11-16 14:07:47.680  INFO 1 --- [           main] liquibase.lockservice                    : Successfully acquired change log lock
2023-11-16 14:07:47.813 ERROR 1 --- [           main] liquibase.parser                         : Premature end of file.
2023-11-16 14:07:47.821  INFO 1 --- [           main] liquibase.lockservice                    : Successfully released change log lock
2023-11-16 14:07:47.836  WARN 1 --- [           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]: Invocation of init method failed; nested exception is liquibase.exception.ChangeLogParseException: Error parsing line 1 column 1 of classpath:db/changelog/db.changelog-master.xml: Premature end of file.
2023-11-16 14:07:47.839  INFO 1 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2023-11-16 14:07:47.858  INFO 1 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2023-11-16 14:07:47.877 ERROR 1 --- [           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 line 1 column 1 of classpath:db/changelog/db.changelog-master.xml: Premature end of file.
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1804) ~[spring-beans-5.3.20.jar!/:5.3.20]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:620) ~[spring-beans-5.3.20.jar!/:5.3.20]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:542) ~[spring-beans-5.3.20.jar!/:5.3.20]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335) ~[spring-beans-5.3.20.jar!/:5.3.20]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.3.20.jar!/:5.3.20]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333) ~[spring-beans-5.3.20.jar!/:5.3.20]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.20.jar!/:5.3.20]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.3.20.jar!/:5.3.20]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208) ~[spring-beans-5.3.20.jar!/:5.3.20]
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1154) ~[spring-context-5.3.20.jar!/:5.3.20]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:908) ~[spring-context-5.3.20.jar!/:5.3.20]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583) ~[spring-context-5.3.20.jar!/:5.3.20]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.8.jar!/:2.6.8]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:745) ~[spring-boot-2.6.8.jar!/:2.6.8]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:420) ~[spring-boot-2.6.8.jar!/:2.6.8]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:307) ~[spring-boot-2.6.8.jar!/:2.6.8]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) ~[spring-boot-2.6.8.jar!/:2.6.8]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-2.6.8.jar!/:2.6.8]
        at lot.platform.manager.attribute.service.rest.AttributeServiceRestApplication.main(AttributeServiceRestApplication.java:29) ~[classes!/:3.2]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
        at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
        at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49) ~[spring-boot-app.jar:3.2]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:108) ~[spring-boot-app.jar:3.2]
        at org.springframework.boot.loader.Launcher.launch(Launcher.java:58) ~[spring-boot-app.jar:3.2]
        at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88) ~[spring-boot-app.jar:3.2]
Caused by: liquibase.exception.ChangeLogParseException: Error parsing line 1 column 1 of classpath:db/changelog/db.changelog-master.xml: Premature end of file.
  • Вопрос задан
  • 74 просмотра
Решения вопроса 1
@WebDiamis Автор вопроса
Ошибка исчезла заменив:
  1. http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.6.xsd -> http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd

  2. https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd -> http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd

Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы