IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml];
2018-03-01 09:32
543 查看
将spring项目转换为springMVC 项目时只配置了MVC
<!-- The front controller of this Spring Web application, responsible for handling all application requests --> <servlet> <servlet-name>spring</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <!-- Map all requests to the DispatcherServlet for handling --> <servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>而忽略了spring的配置:<!-- needed for ContextLoaderListener --><context-param><param-name>contextConfigLocation</param-name><param-value>classpath:applicationContext.xml</param-value></context-param><!-- Bootstraps the root web application context before servlet initialization --><listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener>其中的classpath路径为新的路径,spring默认会到WEB-INF/下找配置文件
相关文章推荐
- 关于IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]的解决
- IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml];
- IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml];
- 异常: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContex
- IOException parsing XML document from class path resource [WebRoot/WEB-INF/applicationContext.xml];
- Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/config/springdemo-config.xml]
- FAQ(7):IOException parsing XML document from ServletContext resource [/calsspath:springmvc.xml];
- IOException parsing XML document from class path resource [springmvc-servlet.xml]; nested exception
- IOException parsing XML document from class path resource [spring-jms-application.xml]; nested
- Unexpected exception parsing XML document from ServletContext resource
- 已经配置了context-param还是出现Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
- SSH三大框架整合问题--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]
- 【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]