記一次nacos版本踩坑記錄

開發(fā)意圖springboot+nacos搭建服務(wù)發(fā)現(xiàn)中心;

開發(fā)準(zhǔn)備:springboot-2.1.11.RELEASE, nacos-2.2.1.RELEASE,cloud-Greenwich.SR4

啟動(dòng)類

@SpringBootApplication

@EnableDiscoveryClient

public class ProvideApplication {

public static void main(String[] args) {

SpringApplication.run(ProvideApplication.class, args);

? ? }

}

報(bào)錯(cuò)信息

java.lang.IllegalStateException: Error processing condition on com.alibaba.cloud.nacos.discovery.reactive.NacosReactiveDiscoveryClientConfiguration.nacosReactiveDiscoveryClient ........

Caused by: java.lang.IllegalStateException: @ConditionalOnMissingBean did not specify a bean using type, name or annotation and the attempt to deduce the bean's type failed.......

Caused by: org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanTypeDeductionException: Failed to deduce bean type for com.alibaba.cloud.nacos.discovery.reactive.NacosReactiveDiscoveryClientConfiguration.nacosReactiveDiscoveryClient....

Caused by: java.lang.NoClassDefFoundError: org/springframework/cloud/client/discovery/ReactiveDiscoveryClient

Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.client.discovery.ReactiveDiscoveryClient

解決

1、查看springboot版本太低,提升至springboot-2.3.2.RELEASE再次啟動(dòng);

? ? ?報(bào)錯(cuò)信息:java.lang.IllegalArgumentException: Could not find class [org.springframework.cloud.client.discovery.composite.reactive.ReactiveCompositeDiscoveryClientAutoConfiguration]

Caused by: java.lang.ClassNotFoundException: org.springframework.cloud.client.discovery.composite.reactive.ReactiveCompositeDiscoveryClientAutoConfiguration

2、更改cloud版本Hoxton.SR4,再次啟動(dòng)。完美啟動(dòng)

總結(jié):springboot版本低于nacos版本會(huì)出現(xiàn)異常;最終解決版本springboot-2.3.2.RELEASE, cloud-Hoxton.SR4,nacos-2.2.1.RELEASE

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。
禁止轉(zhuǎn)載,如需轉(zhuǎn)載請(qǐng)通過簡(jiǎn)信或評(píng)論聯(lián)系作者。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容