@@@@@@@@@@@@@@@@@@@@

问题描述 投票:0回答:1
我正在将一个基于Spring XML config的旧应用程序迁移到Spring Boot,并且有第三方jar在其中引用了@Value("$属性。我尝试在新的Spring Boot工作区中加载一个放置在/resources下的自定义属性文件,并使用@PropertySource("classpath:file")进行加载,但是在Spring Boot运行期间,该属性似乎未加载,并且出现以下错误:

Could not resolve placeholder 'com.example.propertyName' in value "${com.example.propertyName}" at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:178) ~[spring-core-5.2.2.RELEASE.jar:5.2.2.RELEASE]

我正在将一个基于Spring XML config的旧应用程序迁移到Spring Boot,并且有第三方jar,它们具有@Value(“ $$引用的属性。我尝试加载自定义属性文件...
java spring spring-boot
1个回答
0
投票
由于我还是新手,所以我无法发表评论,但是请您粘贴您的代码示例吗?
© www.soinside.com 2019 - 2024. All rights reserved.