Caused by: com.alibaba.nacos.api.exception.NacosException: endpoint is blank

报错信息:

2020-08-29 09:15:43.990 ERROR 436 --- [           main] c.a.cloud.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: java.lang.reflect.InvocationTargetException
    at com.alibaba.nacos.api.config.ConfigFactory.createConfigService(ConfigFactory.java:45) ~[nacos-api-1.1.1.jar:na]
    at com.alibaba.nacos.api.NacosFactory.createConfigService(NacosFactory.java:43) ~[nacos-api-1.1.1.jar:na]
    at com.alibaba.cloud.nacos.NacosConfigProperties.configServiceInstance(NacosConfigProperties.java:346) ~[spring-cloud-alibaba-nacos-config-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    at com.alibaba.cloud.nacos.client.NacosPropertySourceLocator.locate(NacosPropertySourceLocator.java:63) [spring-cloud-alibaba-nacos-config-2.1.0.RELEASE.jar:2.1.0.RELEASE]
    at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:52) [spring-cloud-context-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    at org.springframework.cloud.bootstrap.config.PropertySourceLocator.locateCollection(PropertySourceLocator.java:47) [spring-cloud-context-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    at org.springframework.cloud.bootstrap.config.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:101) [spring-cloud-context-2.1.6.RELEASE.jar:2.1.6.RELEASE]
    at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:623) [spring-boot-2.1.15.RELEASE.jar:2.1.15.RELEASE]
    at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:367) [spring-boot-2.1.15.RELEASE.jar:2.1.15.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) [spring-boot-2.1.15.RELEASE.jar:2.1.15.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) [spring-boot-2.1.15.RELEASE.jar:2.1.15.RELEASE]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1204) [spring-boot-2.1.15.RELEASE.jar:2.1.15.RELEASE]
    at com.unionman.platform.gateway.SpringCloudGatewayApplication.main(SpringCloudGatewayApplication.java:8) [classes/:na]
Caused by: java.lang.reflect.InvocationTargetException: null
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_65]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_65]
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_65]
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_65]
    at com.alibaba.nacos.api.config.ConfigFactory.createConfigService(ConfigFactory.java:42) ~[nacos-api-1.1.1.jar:na]
    ... 12 common frames omitted
Caused by: com.alibaba.nacos.api.exception.NacosException: endpoint is blank
    at com.alibaba.nacos.client.config.impl.ServerListManager.init(ServerListManager.java:154) ~[nacos-client-1.1.1.jar:na]
    at com.alibaba.nacos.client.config.http.ServerHttpAgent.init(ServerHttpAgent.java:244) ~[nacos-client-1.1.1.jar:na]
    at com.alibaba.nacos.client.config.NacosConfigService.init(NacosConfigService.java:83) ~[nacos-client-1.1.1.jar:na]
    ... 17 common frames omitted

 可能原因:maven项目导入了`spring-cloud-starter-alibaba-nacos-config`依赖,但未做config相关配置。

解决方式1:添加config相关配置(分布式配置)

解决方式2:如果没有用到分布式配置,就将这个依赖暂时去掉。

重启问题解决。

最新回复(0)
/jishuM44rJoQsIz6NaZIKQRb_2FppSFYfe4nbSw8l8z14cI5wc_3D4421828
8 简首页