1. 程式人生 > 實用技巧 >記一次由於SpringBoot與SpringCloud版本不對應引發的報錯

記一次由於SpringBoot與SpringCloud版本不對應引發的報錯

一、建立SpringBoot專案 version2.4

二、選擇SpringCloud依賴

<dependency>
	<groupId>org.springframework.boot</groupId>
	<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-openfeign</artifactId>
</dependency>

<dependency>
	<groupId>com.alibaba.cloud</groupId>
	<artifactId>spring-cloud-starter-alicloud-oss</artifactId>
	<version>2.2.0.RELEASE</version>
</dependency>

三、報錯情況

name 'configurationPropertiesBeans' defined in class path resource [org/springframework/cloud/autoconfigure/ConfigurationPropertiesRebinderAutoConfiguration.class]

接下來以為是SpringCloud的nacos線上配置中心設錯了,多次修改發現改的很對還是報錯。於是刪除了bootstrap.properties,重啟發現依舊是報錯。

於是谷歌搜尋報錯資訊。

發現同樣有人一樣的錯誤,

發現了有人有這樣的評論,Compatible!!!

四、不匹配報錯

照著國外友好網友提供的報錯網址,進入了SpringCloud的官網,發現有如下的圖

的確Hoxton的SR9版本是沒有適配SpringBoot2.4,於是將專案降級為SpringBoot2.3.5成功執行。

五、啟發

多用Google!!!

多看官方文件!!!