You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

JEE+WildFly启动时Liquibase报ChangeLogParseException:变更日志不存在

Troubleshooting Liquibase ChangeLogParseException in JEE + WildFly Application

Let's work through this Liquibase ChangeLogParseException you're facing in your JEE + WildFly setup. The error makes it clear Liquibase can't locate your db-changelog.xml file, even though you've confirmed it's in the WAR and tested different path variations. Let's break down the fixes:

Error Log

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"},

Current web.xml Configuration

<!-- 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>

Root Cause Analysis

The first issue jumps out in the error message: the path :classpath/WEB-INF/db-changelog.xml has a leading colon before classpath. Liquibase expects classpath references to follow the format classpath:/path/to/file—the misplaced colon is breaking path parsing entirely.

Fixes to Implement

  1. Correct the Classpath Prefix Format
    Update your liquibase.changelog parameter to use the standard classpath prefix syntax (remove the leading colon and add a slash after classpath:):

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

    This tells Liquibase to look for the file within the web app's classpath, which includes the WEB-INF directory by default.

  2. Try the Servlet Context Path
    If the classpath approach still fails, reference the file directly using the servlet context path (no classpath prefix needed):

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

    The LiquibaseServletListener should resolve this path using the web application's ServletContext without issues.

  3. Validate the WAR Package Structure
    Even if you think the file is in place, extract your WAR to double-check the exact structure. Ensure db-changelog.xml is directly under WEB-INF/ (not nested in a subfolder). The correct structure should look like:

    bets.war/
    ├── WEB-INF/
    │   ├── db-changelog.xml
    │   ├── web.xml
    │   └── classes/
    └── ...
    
  4. Test a Classpath Alternative
    As a quick test, move db-changelog.xml to WEB-INF/classes/ and update the path to classpath:/db-changelog.xml. This bypasses any edge cases with WEB-INF path resolution in WildFly's classloader.

  5. Check Version Compatibility
    Ensure your Liquibase version is compatible with your WildFly release. Older Liquibase versions may have path parsing bugs that don't play well with newer WildFly classloading rules.

内容的提问来源于stack exchange,提问作者Bartosz Gniado

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.29 07:06:34