SpringCloud整合Nacos启动报错:com.alibaba.nacos.api.exception.NacosException: java.lang.reflect.InvocationT

报错内容:

2022-04-25 10:09:01.575 ERROR 14136 — [ 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:
java.lang.reflect.InvocationTargetException
at
com.alibaba.nacos.api.config.ConfigFactory.createConfigService(ConfigFactory.java:45)
~[nacos-api-1.1.4.jar:na] at
com.alibaba.nacos.api.NacosFactory.createConfigService(NacosFactory.java:43)
~[nacos-api-1.1.4.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.1.0.RELEASE.jar:2.1.0.RELEASE] at
org.springframework.boot.SpringApplication.applyInitializers(SpringApplication.java:623)
[spring-boot-2.1.11.RELEASE.jar:2.1.11.RELEASE] at
org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:367)
[spring-boot-2.1.11.RELEASE.jar:2.1.11.RELEASE] at
org.springframework.boot.SpringApplication.run(SpringApplication.java:311)
[spring-boot-2.1.11.RELEASE.jar:2.1.11.RELEASE] at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1215)
[spring-boot-2.1.11.RELEASE.jar:2.1.11.RELEASE] at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1204)
[spring-boot-2.1.11.RELEASE.jar:2.1.11.RELEASE] at
com.demo.api.AppMember.main(AppMember.java:19) [classes/:na]
在这里插入图片描述

问题原因
bootstrap.yml(bootstrap.properties)用来在程序引导时执行,应用于更加早期配置信息读取,如可以使用来配置application.yml中使用到参数等
application.yml(application.properties) 应用程序特有配置信息,可以用来配置后续各个模块中需使用的公共参数等。
解决方式
将application.yml修改为bootstrap.yml,重新启动
在这里插入图片描述

备注:
如果重启之后出现新的报错:

2022-04-25 10:45:02.032 ERROR 12412 — [ main]
o.s.boot.SpringApplication : Application run failed

org.springframework.beans.factory.BeanCreationException: Error
creating bean with name ‘memberServiceImpl’: Injection of autowired
dependencies failed; nested exception is
java.lang.IllegalArgumentException: Could not resolve placeholder
‘demo.userName’ in value " d e m o . u s e r N a m e " a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . a n n o t a t i o n . A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . p o s t P r o c e s s P r o p e r t i e s ( A u t o w i r e d A n n o t a t i o n B e a n P o s t P r o c e s s o r . j a v a : 382 )   [ s p r i n g − b e a n s − 5.1.12. R E L E A S E . j a r : 5.1.12. R E L E A S E ] a t o r g . s p r i n g f r a m e w o r k . b e a n s . f a c t o r y . s u p p o r t . A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . p o p u l a t e B e a n ( A b s t r a c t A u t o w i r e C a p a b l e B e a n F a c t o r y . j a v a : 1404 )   [ s p r i n g

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

超级码里喵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值