当前位置: 首页 > 知识库问答 >
问题:

Liqbase无法解析为URL,因为它不存在

邹博裕
2023-03-14

我不明白Liquibase到底有什么问题,因为路径指定正确

Caused by: java.io.FileNotFoundException: class path resource [db/master.xml] 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:599)
    at liquibase.util.StreamUtil.singleInputStream(StreamUtil.java:186)
    at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:71)
    ... 24 common frames omitted

应用yml文件:

spring:
  liquibase:
    change-log: "classpath:/db/master.xml"

编辑1项目结构

使用编译的类编辑2个文件夹

共有1个答案

潘青青
2023-03-14

尝试删除路径中的前导斜杠

spring:
  liquibase:
    change-log: "classpath:db/master.xml"
 类似资料: