java - 无法将Spring云配置服务器连接到本地存储库窗口

标签 java spring-boot spring-cloud-config

我是 Spring Cloud 新手,我的目标是连接本地 git 存储库(Windows 机器 --> 在文件夹 Z:/Spring_boot_cloud_microservices_udemy/Projects/local-git-repo/创建)但是当我输入其相应的url(http://localhost:8888/limit-services/default)我收到了eclipse的默认whitelabel错误页面,任何人都可以让我识别我的错误吗?

以下是创建的项目:

其中 limit-service 是微服务之一

enter image description here

对应的代码如下:

1]application.properties(限制服务-->微服务)

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 boot主类(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] 链接到 Spring-cloud-server 的本地 git 存储库:

enter image description here

5] 点击以下网址捕获的日志是: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 中提取,工作树不干净。提交文件后我能够得到想要的结果。

关于java - 无法将Spring云配置服务器连接到本地存储库窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61810662/

相关文章:

spring-boot - USERAUTH 因 Github 和 Spring 云配置的私钥文件而失败

java - 如何在泛型类中使用 Enum 的静态函数?

java - 简单的 XML 框架 : Strings in elementlist not having namespace prefix when serializing

java - 无法从 START_ARRAY 中反序列化 java.lang.String 的实例

angularjs - 在部署 Spring Boot 和 Angular JS 应用程序时简化 gradle 构建过程

java - 如何告诉 Spring Boot 使用另一个数据库进行测试?

java - ModelMapper 无法将 java.util.List 转换为 java.util.List

Spring Cloud客户端尝试在服务器端口8888上运行

java - 防止请求在 JSON 文件更新时从 json 文件中获取数据

spring-cloud-config - spring cloud 配置多个配置文件