简体   繁体   English

在春季发布加载属性文件

[英]Issue loading properties file in spring

spring app context file and application.properties files are located under: Spring应用程序上下文文件和application.properties文件位于以下位置:

src/main/resources/META-INF/spring

When I try to load properties file: 当我尝试加载属性文件时:

<context:property-placeholder local-override="true" location="classpath:/META_INF/spring/application.properties"/>

Getting error: 出现错误:

class path resource [META_INF/spring/application.properties] cannot be opened because it does not exist

I also tried: 我也尝试过:

<context:property-placeholder local-override="true" location="classpath:application.properties"/>

<context:property-placeholder local-override="true" location="application.properties"/>

Try: 尝试:

<context:property-placeholder local-override="true" location="classpath:/META-INF/spring/application.properties"/>

instead of: 代替:

<context:property-placeholder local-override="true" location="classpath:/META_INF/spring/application.properties"/>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM