spring - Spring 配置服务器为客户端应用程序中的属性返回 null
问题描述
Spring 配置服务器正常工作并返回以下 URL 响应:-http://localhost:8888/limits-service/default
{
"name": "limits-service",
"profiles": [
"default"
],
"label": null,
"version": "08da3c031373162bca129f75a914f8f4a5ccee8f",
"state": null,
"propertySources": [
{
"name": "https://github.com/miccloudtest/miccloudtest/limits-service.properties",
"source": {
"limits-service.minimum": "1099999",
"limits-service.maximum": "1008888"
}
},
{
"name": "https://github.com/miccloudtest/miccloudtest/application.properties",
"source": {
"spring.application.name": "spring-client-config-server",
"server.port": "8888",
"spring.cloud.config.server.git.uri": "https://github.com/miccloudtest/miccloudtest"
}
}
]
}
但是我的客户端应用程序限制服务返回以下 URL 响应:-http://localhost:8080/limits
{
"maximum": null,
"minimum": null
}
我的整个代码上传到 Git 存储库到以下位置
请帮助我,以便我继续我的春季云学习。提前致谢。
客户端应用程序名称是limit-service。
配置服务器应用程序名称是客户端配置服务器。
Git 资源文件名为limits-servive.properties
.
解决方案
如果您说请求http://localhost:8888/limits-service/default
完成得很好,那么问题一定出在应用程序中。
我建议你使用--debug选项运行应用程序,它会打印很多关于启动的信息。可能有帮助
推荐阅读
- r - 为日期期间提供组 ID
- python - 传递目录路径时出现 argparse 错误中无法识别的参数
- c# - C# Linq - 将空值和周数添加到列表中,当它们丢失时
- javascript - 为什么我的选择器找不到动态添加的元素?
- django - 如何配置我的 Django 序列化程序以根据其唯一约束重用模型(如果存在)?
- computer-science - 计算机科学中的环境和框架有什么区别?
- azure - 无法通过 API 连接到 Azure AD B2C 租户
- .net-core - 诊断在 kubernetes 中运行的 dotnet 核心应用程序的崩溃(通过 Application Insights?)
- php - 循环过去的日期并在 php 中删除
- java - 将 kotlin 的单元转换为 Java 的字符串