在处理简单的字符串注入时,在其他地方找不到这个问题!
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@Configuration("appPropertiesLoader")
@PropertySource(value = "file:${AppPropertyDir}/context.properties")
public class AppPropertiesLoader {
@Value("#{systemProperties.AppPropertyDir}")
private String appPropertyDir;
}
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'AppPropertyDir' in value "file:${AppPropertyDir}/context.properties"
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:174) ~[spring-core-4.3.20.RELEASE.jar:4.3.20.RELEASE]
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) ~[spring-core-4.3.20.RELEASE.jar:4.3.20.RELEASE]