SSM整合时IDE: File is included in 4 contexts

 

 

问题所在:
在spring-dao.xml,spring-service.xml,spring-web.xml没有放在同一个上下文中时

 

 

spring-service.xml中dataSource引入失败(dataSource在spring-dao.xml中已经配置完成)

 

 

当spring-dao.xml,spring-service.xml,spring-web.xml放在同一个上下文中时

 

 

spring-service.xml中dataSource引入成功

 

 

所谓File is included in 4 contexts是因为spring的配置文件放在了多个上下文中,只需找到以上位置,然后保留一个spring的上下文就OK了。

posted @ 2020-05-30 08:46  青衫客36  阅读(787)  评论(0编辑  收藏  举报