Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
2013-08-05 16:59
489 查看
抛错:
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]
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
解决问题:
在web.xml文件中加入如下配置:
原因分析:
问题主要由于加载spring的默认配置文件位置一般是在/WEB-INF/下找applicationContext.xml文件。而Myeclipse文件自动生成的applicationContext文件是放在/WEB-INF/classes/applicationContext.xml。所以在默认加载中是找到applicationContext.xml文件的,必须加入上面配置。
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]
Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
解决问题:
在web.xml文件中加入如下配置:
context-param> <param-name>contextConfigLocation </param-name> <param-value>/WEB-INF/classes/applicationContext-*.xml </param-value> </context-param>
原因分析:
问题主要由于加载spring的默认配置文件位置一般是在/WEB-INF/下找applicationContext.xml文件。而Myeclipse文件自动生成的applicationContext文件是放在/WEB-INF/classes/applicationContext.xml。所以在默认加载中是找到applicationContext.xml文件的,必须加入上面配置。
相关文章推荐
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/classes/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- 【JAVA错误笔记】 - 【Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法】
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- 【转】Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法
- 解决Maven项目启动Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- 【Spring整合Struts2】Could not open ServletContext resource [/WEB-INF/application.xml]错误解决
- Could not open ServletContext resource [/WEB-INF/spring-servlet.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决
- 关于“Could not open ServletContext resource [/WEB-INF/applicationContext.xml]”解决方案
- 关于“Could not open ServletContext resource [/WEB-INF/applicationContext.xml]”解决方案
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- 关于“Could not open ServletContext resource [/WEB-INF/applicationContext.xml]”解决方案
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- 解决Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]