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

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

spring junit 做單元測(cè)試,報(bào) Failed to load ApplicationContext 錯(cuò)誤。

作者:dearLHB 更新時(shí)間: 2022-03-14 編程語(yǔ)言

spring junit 做單元測(cè)試,報(bào) Failed to load ApplicationContext 錯(cuò)誤。

?

查找了好一會(huì),最后發(fā)現(xiàn)。

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

改成

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

就好了。

?

可能是因?yàn)轫?xiàng)目里引用了其他項(xiàng)目,有相同名稱(chēng)的spring配置文件導(dǎo)致的。在classpath后加上*就可以了。

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

欄目分類(lèi)
最近更新