Pradeep
Pradeep

Reputation: 173

Spring cloud config server not loading the properties files

I'm trying to use this sample spring cloud config server application https://github.com/spring-cloud-samples/configserver but it is not working as expected in my local "windows 7" machine.

When I try to access http://localhost:8888/foo/development I'm getting an result as below without any properties

{
  "name": "foo",
  "profiles": [
    "development"
   ],
  "label": "master",
  "propertySources": [
  ]
}

Below are some of the logs related to the property file loading

2015-04-13 17:46:03.381 DEBUG 6684 --- [nio-8888-exec-1] o.s.c.c.s.NativeEnvironmentRepository : Not adding property source: file:/C:/Users/sekhap/git/configserver/target/config/foo-development.properties
2015-04-13 17:46:03.382 DEBUG 6684 --- [nio-8888-exec-1] o.s.c.c.s.NativeEnvironmentRepository : Not adding property source: file:/C:/Users/sekhap/git/configserver/target/config/foo.properties
2015-04-13 17:46:03.382 DEBUG 6684 --- [nio-8888-exec-1] o.s.c.c.s.NativeEnvironmentRepository : Not adding property source: file:/C:/Users/sekhap/git/configserver/target/config/application.yml

Why the properties not getting loaded? Is there any thing to do with Windows environment and because of "/" in front of the C: ?

Upvotes: 2

Views: 3483

Answers (1)

nerdherd
nerdherd

Reputation: 2603

This is a bug in the currently released version (1.0.1.RELEASE), and has been fixed in the current snapshot (1.0.2.BUILD-SNAPSHOT).

The code that checks to see if a configuration should be included was not normalizing the file paths, so when running on Windows it failed because the file path had Windows separators ("\") and the path it compares against has linux separators ("/").

Upvotes: 2

Related Questions