gpt4 book ai didi

java - 在 spring 中加载属性文件时出现问题

转载 作者:行者123 更新时间:2023-12-01 12:00:30 26 4
gpt4 key购买 nike

spring 应用程序上下文文件和 application.properties 文件位于:

src/main/resources/META-INF/spring

当我尝试加载属性文件时:

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

出现错误:

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

我也尝试过:

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

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

最佳答案

尝试:

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

而不是:

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

关于java - 在 spring 中加载属性文件时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28009740/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com