![](/img/trans.png)
[英]Unable to read configurations from local git repository using spring-cloud-config-server
[英]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.