1. 問題描述
啟動web項目時保存 , 該問題出現(xiàn)的原因為 spring 加載 properties 文件時無法找到對應的屬性值 ;
Caused by : java.lang.IllegalArgumentException: Could not resolve placeholder 'xxx' in string value "${xxx}"
2. 問題分析

bug
提示我無法解析占位符 , 導入 log4j 配置文件之后 , 發(fā)現(xiàn)并沒有加載到所對應的properties文件 ;

redis-config.properties
這里只是解析了 "redis-config.properties" 但是并沒有加載 , 所以導致找不到對應的屬性值 ;
3. 問題解決及原因
查了下資料發(fā)現(xiàn) spring 容器中僅允許且最多只會掃描一個 properties 文件 , 當掃描到 properties 時 , 后邊的 properties 文件會被忽略掉 ;
解決方案一
在每個 <context:property-placeholder> 中添加 ignore-unresolvable="true" 屬性 ;

解決方案一
解決方案二
將 properties 所在的文件夾名稱改為一致 ;

解決方案二