嚴重: Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: I
阿新 • • 發佈:2018-11-20
嚴重: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
1.在web.xml中進行如下修改
<!-- Spring監聽器 --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
2:修改後,在listener前面加入如下紅色位置classpath:spring/applicationContext-*.xml為applicationContext.xml的路徑
<!-- Spring監聽器 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/applicationContext-*.xml</param-value> </context-param><listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>