org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/SpringMVC-servlet.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/SpringMVC-servlet.xml]
在学习spring mvc 的过程中遇到的java.io.FileNotFoundException: Could not open ServletContext resource [/WEB…]问题,弄了很久,分享自己的错误给大家参考。
错误表现在能启动tomcate能够进入index.jsp的界面。但是当在地址栏输入需要使用到Dipatcherservlet时会显示500错误。 Could not open ServletContext resource [/WEB-INF/SpringMVC-servlet.xml]
检查sources资源目录 无误。
本人出现的错误是在 web.xml文件中,没有添加Dipatcherservlet 配置文件的路径。
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:springMVC.xml</param-value>
</init-param>
希望能帮助到大家。