nacos异常之com.alibaba.nacos.api.exception.NacosException: null

1.问题描述

1.springboot 类进行启动的时候报如下的错误;
2020-10-27 17:51:44.352 ERROR 28298 --- [           main] o.s.c.a.nacos.NacosConfigProperties      : create config service error!properties=NacosConfigProperties{serverAddr='null', encode='null', group='DEFAULT_GROUP', prefix='null', fileExtension='properties', timeout=3000, endpoint='null', namespace='null', accessKey='null', secretKey='null', contextPath='null', clusterName='null', name='null', sharedDataids='null', refreshableDataids='null', extConfig=null},e=,

com.alibaba.nacos.api.exception.NacosException: null
	at com.alibaba.nacos.api.config.ConfigFactory.createConfigService(ConfigFactory.java:45) ~[nacos-api-1.0.0.jar:na]
	at com.alibaba.nacos.api.NacosFactory.createConfigService(NacosFactory.java:41) ~[nacos-api-1.0.0.jar:na]
	at org.springframework.cloud.alibaba.nacos.NacosConfigProperties.configServiceInstance(NacosConfigProperties.java:343) ~[spring-cloud-alibaba-nacos-config-0.2.2.RELEASE.jar:0.2.2.RELEASE]
	at org.springframework.cloud.alibaba.nacos.client.NacosPropertySourceLocator.locate(NacosPropertySourceLocator.java:63) [spring-cloud-alibaba-nacos-config-0.2.2.RELEASE.jar:0.2.2.RELEASE]
	at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:94) [spring-cloud-context-2.0.3.RELEASE.jar:2.0.3.RELEASE]
	at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:626) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:370) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at com.gaoxinfu.demo.spring.cloud.openfeign.OpenfeignProviderApp.main(OpenfeignProviderApp.java:17) [classes/:na]

2020-10-27 17:51:44.352  WARN 28298 --- [           main] o.s.c.a.n.c.NacosPropertySourceLocator   : no instance of config service found, can't load config from nacos
2020-10-27 17:51:44.355  INFO 28298 --- [           main] c.g.d.s.c.o.OpenfeignProviderApp         : No active profile set, falling back to default profiles: default
2020-10-27 17:51:45.821  INFO 28298 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=e6b3dd03-59d2-39cf-a535-5535008e073f
2020-10-27 17:51:45.953  INFO 28298 --- [           main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$5cec9d8f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2020-10-27 17:51:46.545  INFO 28298 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8079 (http)
2020-10-27 17:51:46.563  INFO 28298 --- [           main] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2020-10-27 17:51:46.564  INFO 28298 --- [           main] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.31]
2020-10-27 17:51:46.795  INFO 28298 --- [           main] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2020-10-27 17:51:46.795  INFO 28298 --- [           main] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 2427 ms
2020-10-27 17:51:46.873  WARN 28298 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2020-10-27 17:51:46.873  INFO 28298 --- [           main] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-10-27 17:51:46.876  WARN 28298 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2020-10-27 17:51:46.876  INFO 28298 --- [           main] c.n.c.sources.URLConfigurationSource     : To enable URLs as dynamic configuration sources, define System property archaius.configurationSource.additionalUrls or make config.properties available on classpath.
2020-10-27 17:51:46.982  INFO 28298 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Initializing ExecutorService 'applicationTaskExecutor'
2020-10-27 17:51:47.116 ERROR 28298 --- [           main] o.s.c.a.nacos.NacosConfigProperties      : create config service error!properties=NacosConfigProperties{serverAddr='null', encode='null', group='DEFAULT_GROUP', prefix='null', fileExtension='properties', timeout=3000, endpoint='null', namespace='null', accessKey='null', secretKey='null', contextPath='null', clusterName='null', name='null', sharedDataids='null', refreshableDataids='null', extConfig=null},e=,

com.alibaba.nacos.api.exception.NacosException: null
	at com.alibaba.nacos.api.config.ConfigFactory.createConfigService(ConfigFactory.java:45) ~[nacos-api-1.0.0.jar:na]
	at com.alibaba.nacos.api.NacosFactory.createConfigService(NacosFactory.java:41) ~[nacos-api-1.0.0.jar:na]
	at org.springframework.cloud.alibaba.nacos.NacosConfigProperties.configServiceInstance(NacosConfigProperties.java:343) ~[spring-cloud-alibaba-nacos-config-0.2.2.RELEASE.jar:0.2.2.RELEASE]
	at org.springframework.cloud.alibaba.nacos.NacosConfigAutoConfiguration.nacosContextRefresher(NacosConfigAutoConfiguration.java:63) [spring-cloud-alibaba-nacos-config-0.2.2.RELEASE.jar:0.2.2.RELEASE]
	at org.springframework.cloud.alibaba.nacos.NacosConfigAutoConfiguration$$EnhancerBySpringCGLIB$$54e7ccf4.CGLIB$nacosContextRefresher$3(<generated>) [spring-cloud-alibaba-nacos-config-0.2.2.RELEASE.jar:0.2.2.RELEASE]
	at org.springframework.cloud.alibaba.nacos.NacosConfigAutoConfiguration$$EnhancerBySpringCGLIB$$54e7ccf4$$FastClassBySpringCGLIB$$21e0473b.invoke(<generated>) [spring-cloud-alibaba-nacos-config-0.2.2.RELEASE.jar:0.2.2.RELEASE]
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) [spring-core-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) [spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.cloud.alibaba.nacos.NacosConfigAutoConfiguration$$EnhancerBySpringCGLIB$$54e7ccf4.nacosContextRefresher(<generated>) [spring-cloud-alibaba-nacos-config-0.2.2.RELEASE.jar:0.2.2.RELEASE]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_211]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_211]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_211]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_211]
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) [spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651) [spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:636) [spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338) [spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177) [spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557) [spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) [spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) [spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) [spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) [spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:879) ~[spring-beans-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.4.RELEASE.jar:5.2.4.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.5.RELEASE.jar:2.2.5.RELEASE]
	at com.gaoxinfu.demo.spring.cloud.openfeign.OpenfeignProviderApp.main(OpenfeignProviderApp.java:17) ~[classes/:na]

2020-10-27 17:51:47.175  INFO 28298 --- [           main] o.s.s.c.ThreadPoolTaskScheduler          : Initializing ExecutorService
2020-10-27 17:51:47.235  WARN 28298 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'compositeCompatibilityVerifier' defined in class path resource [org/springframework/cloud/configuration/CompatibilityVerifierAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.configuration.CompositeCompatibilityVerifier]: Factory method 'compositeCompatibilityVerifier' threw exception; nested exception is org.springframework.cloud.configuration.CompatibilityNotMetException
2020-10-27 17:51:47.237  INFO 28298 --- [           main] o.s.s.concurrent.ThreadPoolTaskExecutor  : Shutting down ExecutorService 'applicationTaskExecutor'
2020-10-27 17:51:47.239  INFO 28298 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2020-10-27 17:51:47.249  INFO 28298 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-10-27 17:51:47.257 ERROR 28298 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Your project setup is incompatible with our requirements due to following reasons:

- Spring Boot [2.2.5.RELEASE] is not compatible with this Spring Cloud release train


Action:

Consider applying the following actions:

- Change Spring Boot version to one of the following versions [2.0.x] .
You can find the latest Spring Boot versions here [https://spring.io/projects/spring-boot#learn]. 
If you want to learn more about the Spring Cloud Release train compatibility, you can visit this page [https://spring.io/projects/spring-cloud#overview] and check the [Release Trains] section.
If you want to disable this check, just set the property [spring.cloud.compatibility-verifier.enabled=false]



Process finished with exit code 1

2.解决方案

1.删除红框中的内容即可

在这里插入图片描述

3.原因分析

nacos作为注册中心,我使用项目名作为服务名注册,启动不会报错,但是访问项目之后,会报错,nacos一直在寻找以我数据库的ip作为的服务名,什么原因? 2019-07-02 14:48:17.850 ERROR [smallcircle-member,,,] 11616 --- [.naming.updater] com.alibaba.nacos.client.naming : [] [] [CALL-SERVER] failed to req API:http://127.0.0.1:8848/nacos/v1/ns/api/srvIPXT. code:404 msg: service not found: DEFAULT_GROUP@@47.98.52.252 2019-07-02 14:48:17.851 ERROR [smallcircle-member,,,] 11616 --- [.naming.updater] com.alibaba.nacos.client.naming : [] [] [NA] req api:/nacos/v1/ns/api/srvIPXT failed, server(127.0.0.1:8848 com.alibaba.nacos.api.exception.NacosException: null at com.alibaba.nacos.client.naming.net.NamingProxy.callServer(NamingProxy.java:304) [nacos-client-0.6.2.jar:na] at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:327) [nacos-client-0.6.2.jar:na] at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:310) [nacos-client-0.6.2.jar:na] at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:257) [nacos-client-0.6.2.jar:na] at com.alibaba.nacos.client.naming.core.HostReactor.updateServiceNow(HostReactor.java:340) [nacos-client-0.6.2.jar:na] at com.alibaba.nacos.client.naming.core.HostReactor$UpdateTask.run(HostReactor.java:429) [nacos-client-0.6.2.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_171] at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_171] at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_171] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_171] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_171] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_171] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_171] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171] 2019-07-02 14:48:17.852 ERROR [smallcircle-member,,,] 11616 --- [.naming.updater] com.alibaba.nacos.client.naming : [] [] [NA] failed to update serviceName: 47.98.52.252
``` 2019-07-02 14:48:17.850 ERROR [smallcircle-member,,,] 11616 --- [.naming.updater] com.alibaba.nacos.client.naming : [] [] [CALL-SERVER] failed to req API:http://127.0.0.1:8848/nacos/v1/ns/api/srvIPXT. code:404 msg: service not found: DEFAULT_GROUP@@47.98.52.252 2019-07-02 14:48:17.851 ERROR [smallcircle-member,,,] 11616 --- [.naming.updater] com.alibaba.nacos.client.naming : [] [] [NA] req api:/nacos/v1/ns/api/srvIPXT failed, server(127.0.0.1:8848 com.alibaba.nacos.api.exception.NacosException: null at com.alibaba.nacos.client.naming.net.NamingProxy.callServer(NamingProxy.java:304) [nacos-client-0.6.2.jar:na] at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:327) [nacos-client-0.6.2.jar:na] at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:310) [nacos-client-0.6.2.jar:na] at com.alibaba.nacos.client.naming.net.NamingProxy.reqAPI(NamingProxy.java:257) [nacos-client-0.6.2.jar:na] at com.alibaba.nacos.client.naming.core.HostReactor.updateServiceNow(HostReactor.java:340) [nacos-client-0.6.2.jar:na] at com.alibaba.nacos.client.naming.core.HostReactor$UpdateTask.run(HostReactor.java:429) [nacos-client-0.6.2.jar:na] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_171] at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) [na:1.8.0_171] at java.util.concurrent.FutureTask.run(FutureTask.java) [na:1.8.0_171] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_171] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.8.0_171] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_171] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_171] at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171] 2019-07-02 14:48:17.852 ERROR [smallcircle-member,,,] 11616 --- [.naming.updater] com.alibaba.nacos.client.naming : [] [] [NA] failed to update serviceName: 47.98.52.252 ```
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页