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

Spring Boot 3.2.x是否兼容Liquibase 3.8.x?升级遇执行器找不到异常

问题描述

将项目从Spring Boot 2.7.18升级到3.2.7后,大部分功能正常运行,但指定Liquibase版本为3.8.9时触发以下异常:

liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find unique implementation of liquibase.executor.Executor.  Found 0 implementations

完整堆栈跟踪:

liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.ServiceNotFoundException: liquibase.exception.ServiceNotFoundException: Could not find unique implementation of liquibase.executor.Executor.  Found 0 implementations
at liquibase.executor.ExecutorService.lambda$getExecutor$0(ExecutorService.java:30) ~[liquibase-core-3.8.9.jar!/:na]
at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708) ~[na:na]
at liquibase.executor.ExecutorService.getExecutor(ExecutorService.java:24) ~[liquibase-core-3.8.9.jar!/:na]
at liquibase.database.AbstractJdbcDatabase.getConnectionSchemaName(AbstractJdbcDatabase.java:359) ~[liquibase-core-3.8.9.jar!/:na]
at liquibase.database.AbstractJdbcDatabase.getDefaultSchemaName(AbstractJdbcDatabase.java:324) ~[liquibase-core-3.8.9.jar!/:na]
at liquibase.changelog.ChangeLogParameters.<init>(ChangeLogParameters.java:61) ~[liquibase-core-3.8.9.jar!/:na]
at liquibase.Liquibase.<init>(Liquibase.java:110) ~[liquibase-core-3.8.9.jar!/:na]

调试发现升级至Liquibase 4.24.x可解决该异常,但该版本存在多线程问题,会引发更多故障。

核心疑问:Liquibase 3.8.x版本是否仍受Spring Boot 3.2.x支持?

解答

1. 兼容性说明

Spring Boot 3.2.x的官方依赖管理中,默认集成的Liquibase版本为4.24.x及以上,Liquibase 3.8.x属于老旧版本(发布于2020年),完全不在Spring Boot 3.x的支持范围内。

Spring Boot 3.x基于Jakarta EE 9+(使用jakarta.*包),而Liquibase 3.8.x仍依赖旧的Java EE API(javax.*包),两者在类路径结构、服务加载机制上存在本质不兼容。你遇到的ServiceNotFoundException正是因为Liquibase 3.8.x的SPI服务加载方式无法适配Spring Boot 3.x的类环境,导致无法找到Executor的实现类。

2. 多线程问题的解决方向

若Liquibase 4.24.x存在多线程故障,可尝试升级至4.25.x或更高稳定版本。Liquibase社区在后续版本中修复了大量并发场景下的问题,比如4.25.0、4.26.0均针对多线程执行逻辑做了优化。

同时需检查项目中是否存在自定义Liquibase配置或扩展代码,这类代码可能在版本升级后出现兼容性问题,需要同步调整。

3. 不推荐的临时方案

如果因特殊需求必须暂时使用Liquibase 3.8.x,需手动处理Jakarta EE与Java EE的API转换,但这会引入大量类路径冲突风险,后续维护成本极高,不建议采用。


内容的提问来源于stack exchange,提问作者Subrhamanya Suresh Hebbar

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.19 06:46:20