我正在使用Spring Cloud,并使用Config-server外部化微服务的属性。
以下是config-server的清单文件
server:
port: 8888
spring:
cloud:
config:
server:
git:
uri: https://github.com/Girdhars/config-server.git
application:
name: config-server
management:
security:
enabled: false
但访问休息端点http://localhost:8888/application/default时,我得到的是异常。
{
"timestamp": 1515082055134,
"status": 404,
"error": "Not Found",
"exception": "org.springframework.cloud.config.server.environment.NoSuchRepositoryException",
"message": "Cannot clone or checkout repository: https://github.com/Girdhars/config-server.git",
"path": "/application/default"
}
您的配置中的存储库指向https://github.com/Girdhars/config-server.git,但在浏览器中导航后,我收到301 Moved permanently
,我被重定向到https://github.com/rathore-girdharsingh/config-server。
所以我认为您的问题与此重定向有关。我发现this StackOverflow answer说:
随着这一变化:2017年2月合并的https://git.eclipse.org/r/#/c/46261/,JGit应该能够遵循HTTP 301状态代码(永久移动)。
顺便说一句,我做了快速检查 - 你的配置现在正在使用新版本的Spring Cloud(Finchley.RELEASE)和Spring Boot(2.0.3.RELEASE)