简体   繁体   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 ) I am getting default whitelabel error page of eclipse ,Can anyone kindly let me identify my mistake. 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 的默认白标签错误页面,谁能让我找出我的错误。

Following are the projects created:以下是创建的项目:

where limit-service is one of the micro service其中limit-service是微服务之一

在此处输入图像描述

Following are its corresponding code:以下是其对应的代码:

1] application.properties (limit-service -- > Micro 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) 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 boot Main class (spring-cloud-server): 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] Local git repo linked to Spring-cloud-server: 4]本地git repo链接到Spring-cloud-server:

在此处输入图像描述

5] logs captured on hitting following url is: http://localhost:8888/limit-services/default 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.

After refering following link: https://github.com/in28minutes/in28minutes-initiatives/tree/master/The-in28Minutes-TroubleshootingGuide-And-FAQ#debugging-problems-with-spring-cloud-config-server i was able to identify my mistake, the mistake was i did not commit application.properties file to my local repo hence i was getting following log info message: 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 拉取,工作树不干净。 after commiting file i was able to get desired result.提交文件后,我能够得到想要的结果。

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

相关问题 无法使用 spring-cloud-config-server 从本地 git 存储库读取配置 - Unable to read configurations from local git repository using spring-cloud-config-server spring 配置服务器 - 用于本地 git 存储库 - spring config server- for local git repository 如果配置服务器关闭,Spring Cloud 配置客户端会加载本地属性 - Spring cloud config client load local properties if the config server is down Spring Cloud Config Server - 用于连接到 github 的用户 ID 和密码 - Spring Cloud Config Server - User id and Password to connect to github Spring Cloud本地与远程Config Server配置 - Spring Cloud local vs remote Config Server configuration 将 spring 云配置服务器连接到本地 git 存储库失败 - connecting spring cloud config server to local git repo failed 无法在 Spring 云配置服务器中从 GIT 读取属性源 - Unable to read property source from GIT in Spring cloud config server Spring Cloud Dataflow Local Server是否需要连接Zookeeper? - Does Spring Cloud Dataflow Local Server need to connect zookeeper? 在 Spring 引导应用程序中使用 Spring 云配置服务器从 Bitbucket 存储库读取外部 YAML/JSON 文件 - Reading an external YAML/JSON File from Bitbucket Repository using Spring Cloud Config Server in a Spring Boot Application 带有配置服务器的 Spring Cloud Eureka - Spring Cloud Eureka with Config Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM