spring-cloud-alibaba icon indicating copy to clipboard operation
spring-cloud-alibaba copied to clipboard

java25 + Spring cloud 2025.1.0 环境下启动报错:EnvironmentPostProcessor

Open a1209577113 opened this issue 1 month ago • 8 comments

我们鼓励使用英文,如果不能直接使用,可以使用翻译软件,您仍旧可以保留中文原文。另外请按照如下要求提交相关信息节省社区维护同学的理解成本,否则该讨论极有可能直接被忽视或关闭。 We recommend using English. If you are non-native English speaker, you can use the translation software. We recommend using English. If you are non-native English speaker, you can use the translation software. In addition, please submit relevant information according to the following requirements to save the understanding cost of community maintenances, otherwise the discussion is very likely to be ignored or closed directly.

Which Component spring-cloud-starter-alibaba-nacos-config-2025.0.0.0

Describe the bug

看着像是兼容spring cloud 2025.1.0的问题 Image

Simplest demo The URL of the simplest demo to reproduce the problem.

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Add any other context about the problem here. e.g. MacOS 、Java8 、 Version 0.2.1.RELEASE

a1209577113 avatar Nov 27 '25 02:11 a1209577113

+1, same issue under this version:

<spring.cloud.version>2025.1.0</spring.cloud.version>
<spring.cloud.alibaba.version>2025.0.0.0</spring.cloud.alibaba.version>

baifachuan avatar Nov 27 '25 09:11 baifachuan

Spring Cloud 2025.1.0 是基于 Spring 7 和 Spring Boot 4 的。其它的升级做适配,只升级 Spring Cloud 肯定有问题啊

herodotus-ecosystem avatar Nov 27 '25 10:11 herodotus-ecosystem

https://github.com/alibaba/spring-cloud-alibaba/blob/2025.1.x/README-zh.md#%E5%A6%82%E4%BD%95%E6%9E%84%E5%BB%BA

Image

xuxiaowei-com-cn avatar Nov 27 '25 10:11 xuxiaowei-com-cn

这个 PR 已修正,待合并:https://github.com/alibaba/spring-cloud-alibaba/pull/4068

xuxiaowei-com-cn avatar Nov 27 '25 16:11 xuxiaowei-com-cn

Spring Cloud 2025.1.0 是基于 Spring 7 和 Spring Boot 4 的。其它的升级做适配,只升级 Spring Cloud 肯定有问题啊

并不是,com.alibaba.cloud.nacos.configdata.NacosConfigDataMissingEnvironmentPostProcessor这个类继承org.springframework.cloud.commons.ConfigDataMissingEnvironmentPostProcessor,在spring boot 4中,这个类实现的接口是org.springframework.boot.EnvironmentPostProcessor,然而,spring-cloud-starter-alibaba-nacos-config-2025.0.0.0.jar中的spring.factories配置的依然是org.springframework.boot.env.EnvironmentPostProcessor,所以导致项目无法启动

shaobin0613 avatar Nov 30 '25 11:11 shaobin0613

Image

dai794251336 avatar Dec 01 '25 12:12 dai794251336

Spring Cloud Alibaba 2025.0.0.0 只能在 Spring 6.X、Spring Boot 3.X 和 Spring Cloud 2025.0.0 环境下运行。

Spring Cloud 2025.1.0,是基于 Spring 7 和 Spring Boot 4 的。Spring Cloud Alibaba 还没有做适配。有代码不兼容很正常。

herodotus-ecosystem avatar Dec 02 '25 09:12 herodotus-ecosystem

正如 @xuxiaowei-com-cn 所说,需要降级到 Spring Boot 3.x (Spring Cloud 2025.0.0)才可使用 spring-cloud-starter-alibaba-nacos-config-2025.0.0.0。不过 sca 2025.1.x (适配 Spring Boot 4.x && Spring Cloud 2025.1.0)正式版也在筹备中了~

uuuyuqi avatar Dec 05 '25 07:12 uuuyuqi

25.1.0 正式版 还要多久发布啊?

AllenDEricDAlexander avatar Dec 17 '25 10:12 AllenDEricDAlexander

Fixed

yuhuangbin avatar Dec 18 '25 06:12 yuhuangbin