nacos 作为配置中心的问题
来源:19-1 Nacos 实现动态配置管理

慕斯卡2532047
2022-05-05
老师:
请忽略这个问题,是自己把文件扩展名写错了,咋还不能删除提问呢?
你好,我仿照您的课程代码,使用nacos作为配置中心,不过启动失败,显示error如下:
BeanCreationException: Error creating bean with name 'scopedTarget.helloController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'mytest.client.name' in value "${mytest.client.name}"
mytest.client.name 是我自己在nacos中配置的。
然后我都仔细检查了,感觉没啥问题。
启动后可以看到如下的输出,说明配置没有问题:
Located property source: [BootstrapPropertySource {name=‘bootstrapProperties-service-teacher-dev.yaml,DEFAULT_GROUP’}, BootstrapPropertySource {name=‘bootstrapProperties-service-teacher.yaml,DEFAULT_GROUP’}, BootstrapPropertySource {name=‘bootstrapProperties-service-teacher,DEFAULT_GROUP’}]
写回答
1回答
-
你这个看不出啥问题啊,先参照课程的实现吧~ 只能推测配置问题了
012022-05-05
相似问题