.properties文件加载失败
生活随笔
收集整理的這篇文章主要介紹了
.properties文件加载失败
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
Spring容器采用反射掃描的發(fā)現(xiàn)機(jī)制,在探測(cè)到Spring容器中有一個(gè)org.springframework.beans.factory.config.PropertyPlaceholderConfigurer的Bean就會(huì)停止對(duì)剩余PropertyPlaceholderConfigurer的掃描(Spring 3.1已經(jīng)使用PropertySourcesPlaceholderConfigurer替代PropertyPlaceholderConfigurer了)。?
而這個(gè)基于命名空間的配置,其實(shí)內(nèi)部就是創(chuàng)建一個(gè)PropertyPlaceholderConfigurer Bean而已。換句話說(shuō),即Spring容器僅允許最多定義一個(gè)PropertyPlaceholderConfigurer(或),其余的會(huì)被Spring忽略掉(其實(shí)Spring如果提供一個(gè)警告就好了)。
?
<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"><property name="locations"><list><value>classpath:jdbc.properties</value><!--<value>classpath:redis.properties</value>--> </list></property> </bean>?
轉(zhuǎn)載地址:https://blog.csdn.net/sinat_36201917/article/details/54411373
總結(jié)
以上是生活随笔為你收集整理的.properties文件加载失败的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: Python可视化模块——Matplot
- 下一篇: 区块链之旅(四)双花攻击、博弈论、Has