英文:
Spring Cloud Config - File extension is not known to any PropertySourceLoader in Openshift
问题
这是我的application.yml文件:
spring:
application:
name: app
version: @project.version@
config:
import: optional:configserver:${CLOUD_CONFIG_SERVER_URL}
cloud:
config:
uri: ${CLOUD_CONFIG_SERVER_URL}
username: ${CLOUD_CONFIG_USERNAME}
password: ${CLOUD_CONFIG_PASSWORD}
label: ${CLOUD_CONFIG_LABEL:develop}
我使用的依赖是:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
Spring Boot版本为2.4.5,这是一个Maven多模块项目。应用程序属性位于'boot'模块中。
在本地一切正常,但在Openshift中,我总是收到以下错误消息:
"File extension is not known to any PropertySourceLoader. If the location is meant to reference a directory, it must end in '/'"
不太确定可能漏掉了什么。
英文:
Here is my application.yml
spring:
application:
name: app
version: @project.version@
config:
import: optional:configserver:${CLOUD_CONFIG_SERVER_URL}
cloud:
config:
uri: ${CLOUD_CONFIG_SERVER_URL}
username: ${CLOUD_CONFIG_USERNAME}
password: ${CLOUD_CONFIG_PASSWORD}
label: ${CLOUD_CONFIG_LABEL:develop}
The dependency I'm using is
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-config</artifactId>
</dependency>
Spring Boot v2.4.5, Maven multi-module project. The application properties are in 'boot' module.
Locally everything is working, but in Openshift I always get:
"File extension is not known to any PropertySourceLoader. If the location is meant to reference a directory, it must end in '/'"
Not really sure what could be missed out.
答案1
得分: 1
我遇到了同样的问题,并通过在config: import语句后添加"/"来解决了它。
config:
import: optional:configserver:${CLOUD_CONFIG_SERVER_URL}/
英文:
I have encountered with the same issue and I have resolved by adding "/" after config: import statement.
config:
import: optional:configserver:${CLOUD_CONFIG_SERVER_URL}/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论