【问题标题】:SpringBoot Config Server file separator issueSpring Boot Config Server 文件分隔符问题
【发布时间】:2021-03-29 23:23:41
【问题描述】:

我已经配置了与 Git 存储库集成的 Spring Boot Config 服务器(2.4.1 版本)。

配置看起来有效,从 git 加载文件期间没有问题,但是当我指向 本地主机:端口/应用程序/开发 我明白了

{"name":"application","profiles":["dev"],"label":null,"version":"7e67e69e075b05d9fa50e3255deef7585ed658c7","state":null,"propertySources":[]}

我打开了所有内容的记录,我发现配置服务器正确下载了文件并将文件保存在临时文件夹中的某个位置,例如:

  (1)  C:/Users/username/AppData/Local/Temp/config-repo-5493381163789847226/

但是 NativeEnironmentRepository 预计它将位于:

(2)   C:\Users\username\AppData\Local\Temp\config-repo-5493381163789847226\

这也是有效的 windows 路径。

当我打开调试器时,我发现 NativeEnvironmentRepository 检查路径(一)

违反模式 (2) 并且失败。所以结果

"propertySources":[]

是空的。

这是 SpringBoot 配置服务器上的错误吗?还是我应该设置/更改配置中的某些内容? 看起来 NativeEnvironmentRepository 应该使用系统 File.separator...

【问题讨论】:

    标签: spring-boot spring-cloud-config-server


    【解决方案1】:

    我在 windows 平台上使用 spring boot 2.4.1 时遇到了同样的问题。由 spring 2.4.2.snapshot 解决。 Spring 2.4.1 在 linux ubuntu 中正常工作。不知道是什么问题。

    【讨论】:

    猜你喜欢
    • 2020-09-05
    • 2016-06-11
    • 2016-06-04
    • 2013-12-11
    • 2022-01-14
    • 2021-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多