nacos配置的练习,能识别到配置文件-located property source。但无法在controller中识别value的值。很奇怪
配置文件bootstarp
spring:
application:
name: userservice
profiles:
active: dev
cloud:
nacos:
server-addr: localhost:8848
config:
file-extension: yaml
nacos配置

这是日志,发现能定位到配置文件,但是controller类读取不到yaml配置中的数据
12-02 12:16:29:974 WARN 16800 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[userservice] & group[DEFAULT_GROUP]
12-02 12:16:29:977 WARN 16800 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[userservice.yaml] & group[DEFAULT_GROUP]
12-02 12:16:29:980 WARN 16800 --- [ main] c.a.c.n.c.NacosPropertySourceBuilder : Ignore the empty nacos configuration and get it based on dataId[userservice-dev.yaml] & group[DEFAULT_GROUP]
12-02 12:16:29:980 INFO 16800 --- [ main] b.c.PropertySourceBootstrapConfiguration : Located property source: [BootstrapPropertySource {name='bootstrapProperties-userservice-dev.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-userservice.yaml,DEFAULT_GROUP'}, BootstrapPropertySource {name='bootstrapProperties-userservice,DEFAULT_GROUP'}]
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'user.age' in value "${user.age}"
缩进,换配置名
能应用映射配置中的数据
已解决。。。 namespace的问题。