Skip to content
Advertisement

Error Creating Bean Error (Spring Cloud Config Client)

I am trying to learn Spring Cloud Config. So first I setup a Server, where I can fetch the properties using http://localhost:9090/config/default/master/app.static.properties on the browser. It has about 5 or 6 properties. I am trying to get just one for now.

I wrote my classes like:

JavaScript

and

JavaScript

My bootstrap.properties look like:

JavaScript

But I get this error:

JavaScript

I searched for the problem on StackOverflow, found a few solutions, tried it. But nothing worked. But since I am getting my feet wet, I am not exactly sure what is going wrong. Am I missing some extra configuration? Any help would be appreciated.

I haven’t posted my server’s code, if needed let me know, I will add it.

Advertisement

Answer

With help for Gregor, I was able to solve it. These are the changes I did:

I added a messageConverter:

JavaScript

And in the bootstrap.properties, added a few extra configs here too:

JavaScript

Now I can fetch the configs from the config server by using the URL http://localhost:9090/app.static/default

So in short:

  1. I had to add messageConverter.
  2. Change the git.config.uri.
  3. And add username/password to the bootstrap.properties because the config server is tied with a username/password.
  4. Remove the spring.config.import properties.
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement