当前位置: 首页 > 知识库问答 >
问题:

无法将Spring cloud config server连接到本地存储库windows

聂涛
2023-03-14

我刚接触spring cloud我的目标是将本地git repo(windows machine-->创建于文件夹z://spring_boot_cloud_microservices_udemy/projects/local-git-repo/)连接到spring cloud Server,但是当我输入相应的url(http://localhost:8888/limit-services/default)时,我得到了eclipse的默认whitelabel错误页面,请允许我指出我的错误。

以下是创建的项目:

其中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 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]本地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.

共有1个答案

帅博远
2023-03-14

在引用以下链接:https://github.com/in28minutes/in28minutes-initiatives/tree/master/the-in28minutes-troleshootingguide-and-faq#debugging-problems-with-spring-cloud-config-server后,我能够识别出我的错误,错误是我没有将application.properties文件提交到本地repo中,因此我得到了以下日志信息消息:不能从远程null,工作树不干净。提交文件后,我能够得到预期的结果。

 类似资料:
  • 我见过几个问题[1][2][3]有点类似于这一点,但没有一个答案产生任何成功。 所以,以下是我看到的问题: 1)pom表明它无法连接到本地。m2存储库。 6)用Java1.7而不是1.8启动Intellij 7)卸载和重新安装Maven、Java和Intellij 非常感谢任何帮助。

  • 问题内容: 我正在尝试在github仓库上连接詹金斯。 当我指定Repo URL jenkins时,返回以下错误消息: 无法连接到存储库:命令“ git ls-remote -h git@github.com:adolfosrs / jenkins-test.git HEAD”返回状态码128:stdout:stderr:主机密钥验证失败。致命:无法从远程存储库读取。请确保您具有正确的访问权限,并

  • 我已经安装了EclipseIDEforJ2EE,现在我正在尝试安装WTP。我在这里和其他地方都试过了。。 没有代理问题,因为我可以通过内部网络浏览器打开存储库网站。 我尝试添加"-Djava.net.preferIPv4Stack=true"到eclipse.ini. 我尝试过清除缓存,一个不同的工作区。。。顺便说一下,我是个十足的新手。以防万一我错过了一些明显的东西。 无法连接到存储库http:

  • 问题内容: 我到处都是Stackoverflow和Google,但我无法解决我的问题。 我的目标 :我想设置Jenkins以使用git SCM通过gerrit克隆存储库主机 我的詹金斯配置 在Windows上作为服务运行的Jenkins版本2.7.1 Git插件版本2.5.3 多个SCM插件版本0.6 Gerrit触发器插件版本2.21.1 问题 该 URL 配置为。是在Windows服务器上启动

  • 我试图连接到一个名为的数据库。所有凭据都位于PHP文件名中,格式为 我正试图用这个连接到数据库 我得到这个错误: 注意:第6行的未定义变量:DB_HOST in/home/content/06/8274306/html/beta/mysuperscript.php 注意:未定义变量:第6行 /home/content/06/8274306/html/beta/mysuperscript.phpDB

  • 我有一个git存储库,它完全存在于我的PC中的本地。我想在github.com上创建它的远程克隆。怎么做呢?