Nacos com.alibaba.nacos.api.exception.NacosException: endpoint is blank

2020-08-04 13:35:45.572 ERROR 63444 — [ 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.PropertySourceBootstrapConfiguration.initialize(PropertySourceBootstrapConfiguration.java:97) [spring-cloud-context-2.1.1.RELEASE.jar:2.1.1.RELEASE]
at org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:649) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:373) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.3.RELEASE.jar:2.1.3.RELEASE]
at me.itwl.gatewayservice.GatewayServiceApplication.main(GatewayServiceApplication.java:10) [classes/:na]
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_181]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_181]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_181]
at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_181]
at com.alibaba.nacos.api.config.ConfigFactory.createConfigService(ConfigFactory.java:42) ~[nacos-api-1.1.1.jar:na]
… 10 common frames omitted
Caused by: com.alibaba.nacos.api.exception.NacosException: endpoint is blank
at com.alibaba.nacos.client.config.impl.ServerListManager.(ServerListManager.java:154) ~[nacos-client-1.1.1.jar:na]
at com.alibaba.nacos.client.config.http.ServerHttpAgent.(ServerHttpAgent.java:244) ~[nacos-client-1.1.1.jar:na]
at com.alibaba.nacos.client.config.NacosConfigService.(NacosConfigService.java:83) ~[nacos-client-1.1.1.jar:na]
… 15 common frames omitted

2020-08-04 13:35:45.573 WARN 63444 — [ main] c.a.c.n.c.NacosPropertySourceLocator : no instance of config service found, can’t load config from nacos

2020-08-04 13:35:49.261 INFO 63444 — [ main] trationDelegate B e a n P o s t P r o c e s s o r C h e c k e r : B e a n ′ o r g . s p r i n g f r a m e w o r k . c l o u d . a u t o c o n f i g u r e . C o n f i g u r a t i o n P r o p e r t i e s R e b i n d e r A u t o C o n f i g u r a t i o n ′ o f t y p e [ o r g . s p r i n g f r a m e w o r k . c l o u d . a u t o c o n f i g u r e . C o n f i g u r a t i o n P r o p e r t i e s R e b i n d e r A u t o C o n f i g u r a t i o n BeanPostProcessorChecker : Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration BeanPostProcessorChecker:Beanorg.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfigurationoftype[org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration E n h a n c e r B y S p r i n g C G L I B EnhancerBySpringCGLIB EnhancerBySpringCGLIB$485e113b] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
在使用spring cloud nacos的时候 报了上面的错误
可能原因:1.删除其选择使用的重复了的jar包,一切正常,没有重复jar包
2. 网上找了一下:Caused by: com.alibaba.nacos.api.exception.NacosException: endpoint is blank

出现原因: 启动nacos消费者时报错

原因:因为pom里加入了spring-cloud-starter-alibaba-nacos-config的依赖,但又没有用到动态配置,所以会报空指针的错,如果只需要用到naocs的服务注册与发现功能,只需要加上spring-cloud-starter-alibaba-nacos-discovery这个依赖即可
3.添加了nacos-config配置,依旧不行。最后发现是由于配置添加的文件application.yml导致,正确的是nacos下应该使用bootstrap.yml文件。当使用 Spring Cloud 的时候,配置信息一般是从 config server 加载的。bootstrap.yml 是被一个父级的 Spring ApplicationContext 加载的。这个父级的 Spring ApplicationContext是先加载的,在加载application.yml 的 ApplicationContext之前。

  • 6
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值