繁体   English   中英

无法将 Spring 云配置服务器连接到本地存储库 windows

[英]Unable to connect Spring cloud config server to local Repository windows

I am new to spring cloud my objective was to connect local git repo (windows machine --> created at folder Z:/Spring_boot_cloud_microservices_udemy/Projects/local-git-repo/) to spring cloud server.But when i enter its corresponding url ( http://localhost:8888/limit-services/default我收到 eclipse 的默认白标签错误页面,谁能让我找出我的错误。

以下是创建的项目:

其中limit-service是微服务之一

在此处输入图像描述

以下是其对应的代码:

1] application.properties (limit-service --> 微服务)

spring.application.name=limit-services
server.port=8081
# custom limits to access for config properties
limit-service.minlimit=121  
# custom limits to access for config properties
limit-service.maxlimit=1  

2] application.properties (spring-cloud-config-server)

spring.application.name=spring-cloud-config-server
server.port=8888
spring.cloud.config.server.git.uri=file://Z:/Spring_boot_cloud_microservices_udemy/Projects/local-git-repo/

3] Spring 启动主 class(spring-cloud-server):

@EnableConfigServername
@SpringBootApplication
public class SpringConfigCloudServerApplication {
public static void main(String[] args) {
        System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(SpringConfigCloudServerApplication.class, args);
    }

}

4]本地git repo链接到Spring-cloud-server:

在此处输入图像描述

5] 在点击 url 时捕获的日志是: http://localhost:8888/limit-services/default

2020-05-15 07:22:03.943  INFO 30412 --- [           main] c.s.s.SpringConfigCloudServerApplication : Started SpringConfigCloudServerApplication in 13.168 seconds (JVM running for 14.341)
2020-05-15 07:22:11.689  INFO 30412 --- [nio-8888-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2020-05-15 07:22:11.690  INFO 30412 --- [nio-8888-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2020-05-15 07:22:11.700  INFO 30412 --- [nio-8888-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 10 ms
2020-05-15 07:22:11.953  INFO 30412 --- [nio-8888-exec-1] .c.s.e.MultipleJGitEnvironmentRepository : Cannot pull from remote null, the working tree is not clean.

参考以下链接后: https://github.com/in28minutes/in28minutes-initiatives/tree/master/The-in28Minutes-TroubleshootingGuide-And-FAQ#debugging-problems-with-spring-cloud-config-server我能够找出我的错误,错误是我没有将 application.properties 文件提交到我的本地仓库,因此我收到以下日志信息消息:无法从远程 null 拉取,工作树不干净。 提交文件后,我能够得到想要的结果。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM