Spring Cloud config Yaml If you are using the git profile, you need to set a Git URI in your configuration.

0

Cześć, w ramach nauki bawię się trochę mikroserwisami.
Stworzyłem config server i mam w nim bootstrap.yml:

server:
  port: 8888
spring:
  application:
    name: configserver
  cloud:
    config:
      discovery:
        enabled: true
      server:
        git:
#          uri: D:/Projects/Gitlab/configuration-repo/
          uri: https://gitlab.com/bartlomiejgora/configuration-repo
          searchPaths: games
eureka:
  client:
    serviceUrl:
      defaultZone: http://localhost:8761/eureka/

Gdy odpalam aplikację to dostaję:

sun.misc.Unsafe.park(Native Method)
 java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
 java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
 java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 java.lang.Thread.run(Thread.java:745)
2019-07-28 10:19:51.827  WARN 18516 --- [           main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start web server; nested exception is org.springframework.boot.web.server.WebServerException: Unable to start embedded Tomcat
2019-07-28 10:19:51.840  INFO 18516 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-07-28 10:19:51.842 ERROR 18516 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Invalid config server configuration.

Action:

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.


Process finished with exit code 1

Nie kumam o co chodzi, mam pod elementem git, mam element uri, więc co jest nie tak?
Czy może to być kwestia formatowania pliku?

0

Nie znam za dobrze Springoweg Config Servera, ale czy przez spring.cloud.config.discovery.enabled=true Twój Config Server nie próbuje znaleźć konfiguracji dla samego siebie w repo Gita (tj. Twój Config Server jest jednocześnie klientem)? Czy w repo Gita masz plik z propertiesami dla config servera?

https://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#discovery-first-bootstrap

0

Hej, dzięki za odpowiedź.
Okazało się że na początku robiłem projekt mavenowy - i tak zaimportowałem do intellij.
Potem zmigrowałem do gradla, i intellij nie załapał czegoś, dlatego nie wstawało.
Przywróciłem do Mavena i działa.

1 użytkowników online, w tym zalogowanych: 0, gości: 1