1. 程式人生 > 實用技巧 >報錯:IOException parsing XML document from class path resource [applicationContext.xml]; nested except

報錯:IOException parsing XML document from class path resource [applicationContext.xml]; nested except

1.出現IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
在這裡插入圖片描述
上面這張圖是我的目錄,它一直說找不到applicationContext.xml檔案,我就納悶了,他一直在啊,路徑沒毛病啊,結果我百度了好久發現在classes在複製一個進去就可以。如圖

2.解決方案
將applicationContext.xml檔案放入到target—>classes包下即可
在這裡插入圖片描述