Spring配置服务器设置IllegalStateException:您需要为git存储库配置一个uri

时间:2018-11-28 22:17:30

标签: spring spring-boot spring-cloud-config spring-config configserver

我正在尝试设置Spring Config服务器。 即使我在配置服务器应用程序的bootstrap.yml中提供了一个bitbucket网址,我仍然会遇到异常。

下面是我的bootstrap.yml(配置服务器)中的示例

spring.application.name: ${SPRING_APPLICATION_NAME:config-server}
sprint.cloud.config.server.git.searchPaths: '{application}'
sprint.cloud.config.server.git.uri: https://XX@bitbucketdc-dg.xyz.net/scm/abc/config-store.git
spring.cloud.config.server.git.username: XX
spring.cloud.config.server.git.password:



org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.autoconfigure.EndpointAutoConfiguration$$EnhancerBySpringCGLIB$$282f5fb1]: Constructor threw exception; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'configServerHealthIndicator' defined in class path resource [org/springframework/cloud/config/server/config/EnvironmentRepositoryConfiguration.class]: Unsatisfied dependency expressed through method 'configServerHealthIndicator' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'environmentRepository' defined in class path resource [org/springframework/cloud/config/server/config/EnvironmentRepositoryConfiguration$GitRepositoryConfiguration.class]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: You need to configure a uri for the git repository

1 个答案:

答案 0 :(得分:0)

删除:

sprint.cloud.config.server.git.searchPaths:'{application}'

因为它用于本地环境。