bootstrap.xml 配置如下
server:
port: 8080
spring:
cloud:
nacos:
discovery:
service: order-serv
server-addr: 192.168.83.190:8848
application:
name: eshop-order-serv
application.xml配置如下:
spring:
cloud:
nacos:
config:
file-extension: yml
server-addr: 192.168.83.190:8848
profiles:
active: dev
application:
name: eshop-order-serv
客户端配置如下图:
但是启动报错:
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder ‘confValue’ in value "${confValue}"
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:178) ~[spring-core-5.2.8.RELEASE.jar:5.2.8.RELEASE]
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124) ~[spring-core-5.2.8.RELEASE.jar:5.2.8.RELEASE]
这个属性值获取不到,不知道为什么?请老师解答下谢谢。
工程图如下