gpt4 book ai didi

java - Liquibase 变更日志不存在 - ChangeLogParseException

转载 作者:行者123 更新时间:2023-12-02 11:12:01 31 4
gpt4 key购买 nike

我正在尝试在 JEE+WildFly 应用程序启动时使用 liquibase。启动AS时,liquibase抛出ChangeLogParseException:

09:41:40,602 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "bets.war" was rolled back with the following failure message: 
{
"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./bets" => "java.lang.RuntimeException: java.lang.RuntimeException: liquibase.exception.ChangeLogParseException: :classpath/WEB-INF/db-changelog.xml does not exist
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: liquibase.exception.ChangeLogParseException: :classpath/WEB-INF/db-changelog.xml does not exist
Caused by: java.lang.RuntimeException: liquibase.exception.ChangeLogParseException: :classpath/WEB-INF/db-changelog.xml does not exist
Caused by: liquibase.exception.ChangeLogParseException: :classpath/WEB-INF/db-changelog.xml does not exist"},

Liquibase 参数在 web.xml 中设置:

<!-- liquibase auto startup -->

<context-param>
<param-name>liquibase.changelog</param-name>
<param-value>:classpath/WEB-INF/db-changelog.xml</param-value>
</context-param>

<context-param>
<param-name>liquibase.datasource</param-name>
<param-value>java:jboss/datasources/BetsDS</param-value>
</context-param>

<context-param>
<param-name>liquibase.onerror.fail</param-name>
<param-value>true</param-value>
</context-param>

<context-param>
<param-name>liquibase.contexts</param-name>
<param-value>production</param-value>
</context-param>

<listener>
<listener-class>liquibase.integration.servlet.LiquibaseServletListener</listener-class>
</listener>

结构如下:

enter image description here

查看了SO中的主题,db-changelog位于.war包中: Unpacked war package

已尝试将 liquibase.changelog 值重命名为 WEB-INF/db-changelog.xml 和/WEB-INF/db-changelog.xml,仍然相同。

最佳答案

已经想通了。将 db-changelog 移至 main/resources/META-INF 并将参数设置为

<param-value>META-INF/db-changelog.xml</param-value>

现在一切正常:

[2018-05-27 11:27:42,823] Artifact bets:war: Artifact is deployed successfully
[2018-05-27 11:27:42,823] Artifact bets:war: Deploy took 13 582 milliseconds

关于java - Liquibase 变更日志不存在 - ChangeLogParseException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50550141/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com