Reputation: 199
We got a spring-boot application which reads it's configuration from a configuration-server.
I encountered a problem reading empty properties using the spring-cloud-configuration-server.
Setting is a KV-pair with no value in application.properties. e.g. MyKey=
Loading it "regular" using just a file no problem is raised.
But when the client uses a configuration-server, the empty value is leading to a:
"java.lang.IllegalArgumentException: Could not resolve placeholder 'MyKey'".
Looks for me there is something weird in the config-server. So here is the application.yml of it:
info:
version: '@project.version@'
artifact: '@project.artifactId@'
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: ****
Any Ideas?
Upvotes: 1
Views: 3014
Reputation: 199
I finally found the problem.
The configuration-server drives an eureka-server aswell. This combination leads to the behavior described above.
Removing the annotation AND the dependency
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-eureka-server</artifactId>
</dependency>
solves the problem.
So our idea to run both services on the same instance is currently not realisable.
Used versions:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Brixton.RS4</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
Upvotes: 1