2015-11-08 58 views
0

enter image description here的ClassPathXmlApplicationContext找不到XML文件

沒有找到
ApplicationContext context = new ClassPathXmlApplicationContext("springTest/BeanTest.xml"); 

拋出文件例外。誰能幫忙?

+0

你能做到 「的classpath *:springTest/BeanText.xml」? –

+0

創建'ClassPathXmlApplicationContext'的代碼在哪裏?如果它在'src/main/resources'中的類中,它將無法在'src/test'中看到這些文件。 –

回答

0

請把BeanTest.xml在src/main/resources目錄的,而不是檢驗目錄,並嘗試

+0

我發現自己很愚蠢。這不是文件未發現異常。這是關於豆......抱歉的傢伙。 – Bill