Closed MaLuxray closed 1 year ago
springboot version 2.6.0 springcloud version 3.1.4 nacosconfig version 2021.1
2.6.0
3.1.4
2021.1
bootstrap.yml
spring: application: name: config-app cloud: nacos: server-addr: locahost:8848 config: group: DEFAULT_GROUP prefix: ${spring.application.name} file-extension: yaml extension-configs: - data-id: redis
配置中心 redis 配置
redis
redis: host: 127.0.0.1 username: amdin password: admin name: redis
配置中心 config-app` 配置
server: port: 15555
java code
@RestController public class RedisController { @Value("${redis.host}") private String redisValue; @GetMapping(value = "/redis") public String redis() { return redisValue; } }
启动服务时报错
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'redis.host' in value "${redis.host}"
当把reids.host改成name又可以正常启动
reids.host
name
It seems nacos has push the config into application, but spring cloud can't parse redis.host . Please move issue to SCA community. From current information it's not nacos' problem.
redis.host
springboot version
2.6.0
springcloud version3.1.4
nacosconfig version2021.1
bootstrap.yml
配置中心
redis
配置配置中心 config-app` 配置
java code
启动服务时报错
当把
reids.host
改成name
又可以正常启动