spring的properties问题

来源:互联网 发布:云计算logo 编辑:程序博客网 时间:2024/05/21 14:09

今天在写配置文件时,遇到一个@Value报错的问题:String 无法转换成Integer

其实是因为application-dao.xml里面加载了properties文件夹下面的db.properties配置文件

application-activemq.xml加载了resource文件夹下的resource.properties配置文件,2者冲突,最后只加载一次

把db.properties和resource.properties都放在resourece里面,在application-dao.xml里面加载,问题就解决了

原创粉丝点击