ihuaylupo / manning-smia

Spring Microservices in Action - Second Edition - Code Examples
MIT License
332 stars 413 forks source link

Chapter 5 Spring cloud config server native configuration is not working. #14

Open wangzt568 opened 3 years ago

wangzt568 commented 3 years ago

Error description: If you are using the git profile, you need to set a Git URI in your configuration. If you are using a native profile and have spring.cloud.config.server.bootstrap=true, you need to use a composite configuration. I have tried other ways like composite. But still not working. Could you help me with this issue?

Will-Estes commented 3 years ago

Add to your POM. This fixed mine.

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-bootstrap</artifactId>
        </dependency>
hannah23280 commented 3 years ago

Add to your POM. This fixed mine.

      <dependency>
          <groupId>org.springframework.cloud</groupId>
          <artifactId>spring-cloud-starter-bootstrap</artifactId>
      </dependency>

Hi, i encounter same issue, but have not yet try your solution. Any idea why adding spring-cloud-starter-bootstrap would solve the problem? I read online articles, but none mention about using bootstrap

hannah23280 commented 3 years ago

Add to your POM. This fixed mine.

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-bootstrap</artifactId>
        </dependency>

Hi, i encounter same issue, but have not yet try your solution. Any idea why adding spring-cloud-starter-bootstrap would solve the problem? I read online articles, but none mention about using bootstrap

Think i know why, it is needed for bootstrap.yml to work

Will-Estes commented 3 years ago

@hanct That's correct, I think the spring team removed the bootstrap dependency from the starter dependencies. So you need to include it separately now.

duydoanx commented 2 years ago

You can see the answer here: https://stackoverflow.com/a/65009480

AnshuSoni commented 2 years ago

For me, adding , spring-cloud-starter-bootstrap dependency did not work, but when I have put same configuration in application.properties, it started working. Is it fine ?

Will-Estes commented 2 years ago

For me, adding , spring-cloud-starter-bootstrap dependency did not work, but when I have put same configuration in application.properties, it started working. Is it fine ?

Since bootstrap has been deprecated for newer versions of Spring, I think putting it in the application.properties is fine. Check out this StackOverflow (as posted earlier by duydoanx)

Alphabtw00 commented 9 months ago

For me, adding , spring-cloud-starter-bootstrap dependency did not work, but when I have put same configuration in application.properties, it started working. Is it fine ?

Since bootstrap has been deprecated for newer versions of Spring, I think putting it in the application.properties is fine. Check out this StackOverflow (as posted earlier by duydoanx)

is it? im still using it and without that dependency bootstrap.properties wont work but with it it works. using spring boot 3.1.4