【JAVA错误笔记】 - 【Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法】
2016-08-22 23:42
836 查看
错误描述:
Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
原因分析:
问题主要由于加载spring的默认配置文件位置一般是在/WEB-INF/下找applicationContext.xml文件。
而Myeclipse文件自动生成的applicationContext文件是放在/WEB-INF/classes/applicationContext.xml。
所以在默认加载中是找到applicationContext.xml文件的,必须加入上面配置。
解决方案:
在web.xml中加入:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:applicationContext*.xml</param-value>
</context-param>
皆可解决!
相关文章推荐
- 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]解决方法
- 【Spring整合Struts2】Could not open ServletContext resource [/WEB-INF/application.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/classes/applicationContext.xml]解决方法
- Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决
- Could not open ServletContext resource [/WEB-INF/spring-servlet.xml]解决方法
- 解决Maven项目启动Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/action-servlet.xml]
- 已经配置了context-param还是出现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]”解决方案