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

Spring Boot 2.7.18升级至3.1.0时SCDF应用启动报错求助

解决Spring Boot 3.1.0升级后SCDF应用的WavefrontProperties类找不到问题

问题场景

升级SCDF应用从Spring Boot 2.7.18到3.1.0后,启动抛出如下错误:

java.lang.NoClassDefFoundError: org/springframework/boot/actuate/autoconfigure/metrics/export/wavefront/WavefrontProperties
at org.springframework.cloud.dataflow.server.config.MetricsReplicationEnvironmentPostProcessor.postProcessEnvironment(MetricsReplicationEnvironmentPostProcessor.java:107)

类路径中存在org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontProperties,但旧包路径的类始终找不到。

问题原因

Spring Boot 3.0+对Wavefront监控相关的配置类包结构做了调整:

  • Spring Boot 2.x中,WavefrontProperties的路径是org.springframework.boot.actuate.autoconfigure.metrics.export.wavefront.WavefrontProperties
  • Spring Boot 3.x中,该类被迁移到了org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontProperties

当前使用的SCDF版本未适配Spring Boot 3.x的包结构变化,导致MetricsReplicationEnvironmentPostProcessor仍在尝试加载旧路径的类。

解决方案

  1. 同步升级SCDF到兼容版本
    Spring Boot 3.x需要搭配SCDF 2.11.x及以上版本使用,若当前SCDF版本过低,直接升级到对应兼容版本即可解决类路径引用问题。

  2. 修正自定义代码中的类引用(如果有)
    若项目中自定义了引用WavefrontProperties的代码,或者修改过MetricsReplicationEnvironmentPostProcessor,将所有旧包路径的引用替换为新路径:
    把import org.springframework.boot.actuate.autoconfigure.metrics.export.wavefront.WavefrontProperties;
    替换为import org.springframework.boot.actuate.autoconfigure.wavefront.WavefrontProperties;

  3. 清理依赖缓存并重新构建
    执行构建工具的清理命令(比如Maven的mvn clean install,Gradle的clean build),清除本地缓存的旧依赖,确保新的包路径类被正确引入到类路径中。

内容的提问来源于stack exchange,提问作者anudeep kn

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.25 08:13:17