环境:MyEclipse6.5+ Tomcat6.0.18+Struts2.1+Hibernate3.2+Spring2.5.6
问题:启动Tomcat出现如下异常:
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]
解决:出现这个问题是项目找不到配置文件。只要在web.xml中配置applicationContext.xml的路径即可。
比如我添加如下代码:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
参考资料:
http://www.cnblogs.com/tjsquall/archive/2009/01/05/1368784.html
分享到:
相关推荐
Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0' defined in ServletContext resource [/WEB-INF/springMVC-servlet.xml]: Initialization of bean failed;...
Files contained in javax.servlet.jar: META-INF/MANIFEST.MF ...META-INF/maven/org.mortbay.jetty/servlet-api-2.5/pom.xml META-INF/maven/org.mortbay.jetty/servlet-api-2.5/pom.properties
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed;...
org.springframework.web.context.support.ServletContextResource.class org.springframework.web.context.support.ServletContextResourceLoader.class org.springframework.web.context.support....
- Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher.xml] - JSR-330 'javax.inject.Named' annotation found and supported for component scanning - JSR-330 'javax.inject....
public static final String DEFAULT_CONFIG_LOCATION = "/WEB-INF/applicationContext.xml"; public static final String DEFAULT_CONFIG_LOCATION_PREFIX = "/WEB-INF/"; public static final String DEFAULT...
Error registering bean with name 'myDataSource' defined in ServletContext resource 下载commons-pool-1.x.jar,commons-dbcp.jar文件,导入lib目录下
A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both. Filters perform filtering in the ...
Ssh获取ServletContext 只需要更改struts-config action中的type就可以了ru :type="com.uo.spring.SpringDelegatingActionProxy" 大家有什么疑问可以直接去我的blog查看...《[正解]Ssh获取ServletContext》
Servlet生命周期,及servlet相关知识点的总结。
<param-value>/WEB-INF/view/</param-value> </init-param> <init-param> <param-name>suffix</param-name> <param-value>.jsp</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name...
NULL 博文链接:https://llxhna.iteye.com/blog/1067851
javax.servlet.ServletContext javax.servlet.ServletRequest javax.servlet.http.HttpUtils javax.servlet.ServletResponse javax.servlet.ServletException javax.servlet.http.HttpServlet javax.servlet....
接收消息:从ServletContext中获取消息,如果不为空则输出消息。 5. 在线人员列表显示功能的实现 将登录进系统的用户与其对应的session存储到一个userMap中,然后显示出来 6. 踢人功能的实现 接收前台传来的...
ServletContext读取web应用中的资源文件
application.getRequestDispatcher("/WEB-INF/front/success.jsp").forward(req, resp); return; } req.setAttribute("err", listErr); req.getRequestDispatcher("/err.jsp").forward(req, resp);...
... ... ... import javax.servlet.RequestDispatcher;...import javax.servlet.ServletContext;... response.sendRedirect("../admin/success.jsp"); }else{ //失败跳转回登录页面 //out.println("登录失败"); ...
本书共分4部分,从xml、servlet、jsp和应用的角度向读者展示了java web开发中各种技术的应用,循序渐进地引导读者快速掌握java web开发。. 本书内容全面,涵盖了从事java web开发所应掌握的所有知识。在知识的讲解...
4.3.4. ServletContextResource 4.3.5. InputStreamResource 4.3.6. ByteArrayResource 4.4. ResourceLoader 4.5. ResourceLoaderAware 接口 4.6. 把Resource作为属性来配置 4.7. Application context 和...
4.3.4. ServletContextResource 4.3.5. InputStreamResource 4.3.6. ByteArrayResource 4.4. ResourceLoader 4.5. ResourceLoaderAware 接口 4.6. 把Resource作为属性来配置 4.7. Application context 和...