Exception Servlet.init() for servlet [mvc] threw exception

Root Cause

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [springmvc.xml]; nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be opened because it does not exist

這類報錯500問題通常是路徑或者配置問題:
有三種:
1、在springmvc.xml中寫 <mvc:annotation-driven />的時候,idea推薦的XML約束是cache的,我們把它全換成mvc的就可以了.
2、錯把applicationContext.xml放在了java包下,應該放在resource下
3、配置錯誤,在idea中ctrl+alt+shift+s,左側Modules選項中點擊在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章