nacos-discovery包名層級(jí)問(wèn)題解決
問(wèn)題
Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfiguration required a bean of type 'com.netflix.client.config.IClientConfig' that could not be found.
使用 com 包名層級(jí)運(yùn)行
運(yùn)行結(jié)果:
2021-01-07 11:17:09.441 INFO 3848 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.2.12.RELEASE)
2021-01-07 11:17:10.294 INFO 3848 --- [ restartedMain] com.OrderNacosMain83 : No active profile set, falling back to default profiles: default
2021-01-07 11:17:13.128 WARN 3848 --- [ restartedMain] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'nacos-discovery' contains invalid characters, please migrate to a valid format.
2021-01-07 11:17:13.430 WARN 3848 --- [ restartedMain] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2021-01-07 11:17:13.688 INFO 3848 --- [ restartedMain] o.s.cloud.context.scope.GenericScope : BeanFactory id=17c50fdc-ef7b-36a2-a80c-63c33ed55773
2021-01-07 11:17:14.573 INFO 3848 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 83 (http)
2021-01-07 11:17:14.591 INFO 3848 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-01-07 11:17:14.591 INFO 3848 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.41]
2021-01-07 11:17:14.772 INFO 3848 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2021-01-07 11:17:14.773 INFO 3848 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 4452 ms
2021-01-07 11:17:15.216 WARN 3848 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ribbonServerList' defined in class path resource [com/alibaba/cloud/nacos/ribbon/NacosRibbonClientConfiguration.class]: Unsatisfied dependency expressed through method 'ribbonServerList' parameter 0; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.netflix.client.config.IClientConfig' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2021-01-07 11:17:15.220 INFO 3848 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2021-01-07 11:17:15.245 INFO 3848 --- [ restartedMain] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-01-07 11:17:15.577 ERROR 3848 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method ribbonServerList in com.alibaba.cloud.nacos.ribbon.NacosRibbonClientConfiguration required a bean of type 'com.netflix.client.config.IClientConfig' that could not be found.
Action:
Consider defining a bean of type 'com.netflix.client.config.IClientConfig' in your configuration.
使用 com.xxx 包名層級(jí)運(yùn)行
運(yùn)行結(jié)果:
2021-01-07 11:17:09.441 INFO 3848 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor
: Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.2.12.RELEASE)2021-01-07 11:17:10.294 INFO 3848 --- [ restartedMain] com.OrderNacosMain83 : No active profile set, falling back to default profiles: default
2021-01-07 11:17:13.128 WARN 3848 --- [ restartedMain] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'nacos-discovery' contains invalid characters, please migrate to a valid format.
2021-01-07 11:17:13.430 WARN 3848 --- [ restartedMain] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2021-01-07 11:17:13.688 INFO 3848 --- [ restartedMain] o.s.cloud.context.scope.GenericScope : BeanFactory
解決辦法
使用多層級(jí)包名來(lái)運(yùn)行項(xiàng)目
此項(xiàng)目使用版本
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com</groupId> <artifactId>stu-alibaba</artifactId> <packaging>pom</packaging> <version>1.0-SNAPSHOT</version> <properties> <maven.compiler.source>15</maven.compiler.source> <maven.compiler.target>15</maven.compiler.target> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <spring-cloud.version>Hoxton.SR8</spring-cloud.version> <spring-boot.version>2.2.12.RELEASE</spring-boot.version> <spring-cloud-alibaba.version>2.2.3.RELEASE</spring-cloud-alibaba.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>${spring-cloud.version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-dependencies</artifactId> <version>${spring-boot.version}</version> <type>pom</type> <scope>import</scope> </dependency> <dependency> <groupId>com.alibaba.cloud</groupId> <artifactId>spring-cloud-alibaba-dependencies</artifactId> <version>${spring-cloud-alibaba.version}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <version>2.4.0</version> </plugin> </plugins> </build> </project>
以上就是nacos-discovery包名層級(jí)問(wèn)題解決的詳細(xì)內(nèi)容,更多關(guān)于nacos discovery包名層級(jí)的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!
- Nacos?Discovery服務(wù)治理解決方案
- 關(guān)于IDEA中spring-cloud-starter-alibaba-nacos-discovery 無(wú)法引入問(wèn)題
- 關(guān)于Nacos和Eureka的區(qū)別及說(shuō)明
- 關(guān)于Nacos配置管理的統(tǒng)一配置管理、自動(dòng)刷新詳解
- elasticsearch集群發(fā)現(xiàn)zendiscovery的Ping機(jī)制分析
- elasticsearch集群cluster?discovery可配式模塊示例分析
- elasticsearch的zenDiscovery和master選舉機(jī)制原理分析
相關(guān)文章
深入了解Spring中最常用的11個(gè)擴(kuò)展點(diǎn)
我們一說(shuō)到spring,可能第一個(gè)想到的是?IOC(控制反轉(zhuǎn))?和?AOP(面向切面編程)。除此之外,我們?cè)谑褂胹pring的過(guò)程中,有沒(méi)有發(fā)現(xiàn)它的擴(kuò)展能力非常強(qiáng)。今天就來(lái)跟大家一起聊聊,在Spring中最常用的11個(gè)擴(kuò)展點(diǎn)2022-09-09Java bat批處理命令啟動(dòng)jar包的操作方法
這篇文章主要介紹了JAVA bat批處理命令啟動(dòng)jar包,本文給大家介紹的非常詳細(xì),感興趣的朋友跟隨小編一起看看吧2024-12-12Spring Boot與Kotlin處理Web表單提交的方法
本篇文章主要介紹了Spring Boot 與 Kotlin 處理Web表單提交的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-01-01解決@NonNull @org.jetbrains.annotations.NotNull報(bào)紅的問(wèn)題
這篇文章主要介紹了解決@NonNull @org.jetbrains.annotations.NotNull報(bào)紅的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-01-01Spring boot詳解緩存redis實(shí)現(xiàn)定時(shí)過(guò)期方法
本篇文章分享的就是spring boot中的一個(gè)輪子,spring cache注解的方式實(shí)現(xiàn)接口數(shù)據(jù)緩存。默認(rèn)的配置想非常簡(jiǎn)單,但是有一個(gè)弊端是緩存數(shù)據(jù)為永久緩存,本次將介紹如何設(shè)置接口緩存數(shù)據(jù)的過(guò)期時(shí)間2022-07-07Java中BigInteger類(lèi)的使用方法詳解(全網(wǎng)最新)
這篇文章主要介紹了Java中BigInteger類(lèi)的使用方法詳解,常用最全系列,本章作為筆記使用,內(nèi)容比較全面,但常用的只有:構(gòu)造函數(shù),基本運(yùn)算以及compareTo(),intValue(),setBit(),testBit()方法,需要的朋友可以參考下2023-05-05java進(jìn)階解析Springboot上傳excel存入數(shù)據(jù)庫(kù)步驟
項(xiàng)目需要,寫(xiě)了一個(gè),批量導(dǎo)入的接口。因?yàn)樾枰褂胑xcel去批量導(dǎo)入數(shù)據(jù),所以寫(xiě)了一個(gè)例子,經(jīng)過(guò)測(cè)試已經(jīng)可以用于實(shí)際開(kāi)發(fā),這里記錄一下2021-09-09clickhouse?批量插入數(shù)據(jù)及ClickHouse常用命令詳解
這篇文章主要介紹了clickhouse?批量插入數(shù)據(jù)及ClickHouse常用命令,本文給大家介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2022-03-03java去除集合中重復(fù)元素示例分享 java去除重復(fù)
這篇文章主要介紹了java去除集合中重復(fù)元素示例,大家參考使用吧2014-01-01