如果你的项目有多个spring的配置文件,如spring-dao.xml ,spring-redis.xml,那么 你只能在一个文件中使用context:property-placeholder标签,其他文件中的context:property-placeholder标签将会失效不能读取以致于报错:
解决:
只在一个spring的配置文件中使用context:property-placeholder标签,并加载多个properties文件:
<context:property-placeholder location="classpath:jdbc.properties,classpath:redis.properties"/>