0
我们得到了一个spring-boot应用程序,它从配置服务器读取它的配置。application.properties中的空值导致“无法解析占位符”异常
我在使用spring-cloud-configuration-server读取空属性时遇到了问题。
设置是在application.properties中没有值的KV对。 例如 MyKey =
仅使用文件加载它“常规”没有问题引发。
但是,当客户端使用的配置服务器,空值导致:
“java.lang.IllegalArgumentException异常:无法解析占位符‘的myKey’”。
寻找我配置服务器中有些奇怪的东西。 因此,这里是它的application.yml:
info:
version: '@[email protected]'
artifact: '@[email protected]'
server:
port: 10805
spring:
application:
name: ${info.artifact}
http:
encoding:
charset: UTF-8
boot:
admin:
discovery:
enabled: true
context-path: /admin
jmx:
enabled: false
endpoints:
jmx:
enabled: false
turbine:
combineHostPort: true
app-config: service.us
clusterNameExpression: "'default'"
---
spring:
profiles: win
eureka:
server:
disable-delta: true
disable-delta-for-remote-regions: true
instance:
hostname: ${COMPUTERNAME}
client:
serviceUrl:
defaultZone: http://localhost:10805/eureka/
archaius:
deployment:
datacenter: ${eureka.instance.hostname}
environment: local
---
spring:
profiles: default
eureka:
instance:
virtual-host-name: ${eureka.instance.appname}
app-group-name: ces
appname: admin.ces
---
spring:
profiles:
active: subversion
cloud:
config:
server:
svn:
uri : https://myserver/svn/ces/trunk/config/
username: conf
password: ****
什么想法?