日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

spring junit 做單元測試,報 Failed to load ApplicationContext 錯誤。

作者:dearLHB 更新時間: 2022-03-14 編程語言

spring junit 做單元測試,報 Failed to load ApplicationContext 錯誤。

?

查找了好一會,最后發現。

@ContextConfiguration(locations = { "classpath:spring*.xml", "classpath:struts.xml", "classpath:spring-hibernate.xml" })

改成

@ContextConfiguration(locations = { "classpath*:spring*.xml", "classpath*:struts.xml", "classpath*:spring-hibernate.xml" })

就好了。

?

可能是因為項目里引用了其他項目,有相同名稱的spring配置文件導致的。在classpath后加上*就可以了。

原文鏈接:https://blog.csdn.net/dearLHB/article/details/46290983

欄目分類
最近更新