构建SpringCloudAlibaba项目报错:Cannot instantiate interface org.springframework.boot.BootstrapRegistryInit
如图:
出现这个原因的根本是:
spring-boot、spring-cloud、spring-cloud-alibaba出现版本冲突导致。
由于Spring Cloud Alibaba基于spring-cloud部分组件来实现,所以对应版本要保持正确的映射关系。
下面整理了部分映射关系如下:
Spring Boot版本 | Spring Cloud版本 | Spring Cloud Alibaba版本 |
---|---|---|
3.0.2 | SpringCloud2022.0.0 | 2022.0.0.0 |
3.0.2 | SpringCloud2022.0.0 | 2022.0.0.0-RC2 |
3.0.0 | SpringCloud2022.0.0 | 2022.0.0.0-RC1 |
2.6.13 | SpringCloud2021.0.5 | 2021.0.5.0 |
2.6.11 | SpringCloud2021.0.4 | 2021.0.4.0 |
2.6.3 | SpringCloud2021.0.1 | 2021.0.1.0 |
2.4.2 | SpringCloud2020.0.1 | 2021.1 |
2.3.12.RELEASE | SpringCloudHoxton.SR12 | 2.2.10-RC1 |
2.3.12.RELEASE | SpringCloudHoxton.SR12 | 2.2.9.RELEASE |
2.3.12.RELEASE | SpringCloudHoxton.SR12 | 2.2.8.RELEASE |
2.3.12.RELEASE | SpringCloudHoxton.SR12 | 2.2.7.RELEASE |
2.3.2.RELEASE | SpringCloudHoxton.SR9 | 2.2.6.RELEASE |
2.2.5.RELEASE | SpringCloudHoxton.SR3 | 2.2.1.RELEASE |
2.2.X.RELEASE | SpringCloudHoxton.RELEASE | 2.2.0.RELEASE |
2.1.13.RELEASE | SpringCloudGreenwich.SR6 | 2.1.4.RELEASE |
2.1.X.RELEASE | SpringCloudGreenwich2.1.2.RELEASE |
其中Spring Cloud Alibaba与其组件版本对应关系如下:
Spring Cloud Alibaba 版本 | Sentinel 版本 | Nacos 版本 | RocketMQ 版本 | Dubbo 版本 | Seata 版本 |
---|---|---|---|---|---|
2022.0.0.0 | 1.8.6 | 2.2.1 | 4.9.4 | ~ | 1.7.0 |
2022.0.0.0-RC2 | 1.8.6 | 2.2.1 | 4.9.4 | ~ | 1.7.0-native-rc2 |
2021.0.5.0 | 1.8.6 | 2.2.0 | 4.9.4 | ~ | 1.6.1 |
2.2.10-RC1 | 1.8.6 | 2.2.0 | 4.9.4 | ~ | 1.6.1 |
2022.0.0.0-RC1 | 1.8.6 | 2.2.1-RC | 4.9.4 | ~ | 1.6.1 |
2.2.9.RELEASE | 1.8.5 | 2.1.0 | 4.9.4 | ~ | 1.5.2 |
2021.0.4.0 | 1.8.5 | 2.0.4 | 4.9.4 | ~ | 1.5.2 |
2.2.8.RELEASE | 1.8.4 | 2.1.0 | 4.9.3 | ~ | 1.5.1 |
2021.0.1.0 | 1.8.3 | 1.4.2 | 4.9.2 | ~ | 1.4.2 |
2.2.7.RELEASE | 1.8.1 | 2.0.3 | 4.6.1 | 2.7.13 | 1.3.0 |
2.2.6.RELEASE | 1.8.1 | 1.4.2 | 4.4.0 | 2.7.8 | 1.3.0 |
2021.1 or 2.2.5.RELEASE or 2.1.4.RELEASE or 2.0.4.RELEASE | 1.8.0 | 1.4.1 | 4.4.0 | 2.7.8 | 1.3.0 |
2.2.3.RELEASE or 2.1.3.RELEASE or 2.0.3.RELEASE | 1.8.0 | 1.3.3 | 4.4.0 | 2.7.8 | 1.3.0 |
2.2.1.RELEASE or 2.1.2.RELEASE or 2.0.2.RELEASE | 1.7.1 | 1.2.1 | 4.4.0 | 2.7.6 | 1.2.0 |
2.2.0.RELEASE | 1.7.1 | 1.1.4 | 4.4.0 | 2.7.4.1 | 1.0.0 |
2.1.1.RELEASE or 2.0.1.RELEASE or 1.5.1.RELEASE | 1.7.0 | 1.1.4 | 4.4.0 | 2.7.3 | 0.9.0 |
2.1.0.RELEASE or 2.0.0.RELEASE or 1.5.0.RELEASE | 1.6.3 | 1.1.1 | 4.4.0 | 2.7.3 | 0.7.1 |
参考来源:
spring-cloud-alibaba : spring-cloud-alibaba
查询springcloud和springboot对应关系如下:
Spring Cloud: Spring Cloud