`

Could not open ServletContext resource [/WEB-INF/a

阅读更多

 

 错误如下:

org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from resource [/WEB-INF/applicationContext.xml] of ServletContext; nested exception is java.io.FileNotFoundException: Could not open resource [/WEB-INF/applicationContext.xml] of ServletContext
java.io.FileNotFoundException: Could not open resource [/WEB-INF/applicationContext.xml] of ServletContext

加载spring的配置文件时在默认位置/WEB-INF/下找不到applicationContext.xml文件,看了下,myeclipse自动生成的applicationContext.xml放在/WEB-INF/classes下,难怪找不到,终于发现问题了,下面在web.xml中做如下配置即可解决:

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/classes/applicationContext.xml</param-value>  
</context-param>

分享到:
评论
1 楼 iamaj2eeprogrammer 2011-10-27  
         

相关推荐

    org.springframework.web.servlet-3.0.1.RELEASE-A.jar

    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;...

    javax.servlet.jar下载

    javax.servlet.ServletContext.class javax.servlet.RequestDispatcher.class javax.servlet.Servlet.class javax.servlet.ServletException.class javax.servlet.ServletRequest.class javax.servlet.Servlet...

    S2SH整合报错

    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed;...

    轻量级java web MVC框架

    &lt;param-value&gt;/WEB-INF/view/&lt;/param-value&gt; &lt;/init-param&gt; &lt;init-param&gt; &lt;param-name&gt;suffix&lt;/param-name&gt; &lt;param-value&gt;.jsp&lt;/param-value&gt; &lt;/init-param&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name...

    spring源代码解析

    简单的说,在web容器中,通过ServletContext为Spring的IOC容器提供宿主环境,对应的建立起一个IOC容器的体系。其中,首先需要建立的是根上下文,这个上下文持有的对象可以有业务对象,数据存取对象,资源,事物管理...

    Struts2+Spring3+MyBatis3完整实例

    - 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....

    spring-web-2.5.jar

    org.springframework.web.context.support.ServletContextResource.class org.springframework.web.context.support.ServletContextResourceLoader.class org.springframework.web.context.support....

    ServletContext读取web应用中的资源文件.doc

    ServletContext读取web应用中的资源文件

    commons-pool-1.x.jar,commons-dbcp.jar

    Error registering bean with name 'myDataSource' defined in ServletContext resource 下载commons-pool-1.x.jar,commons-dbcp.jar文件,导入lib目录下

    投票系统,基于mvc开发,jsp+servlet+mysql

    application.getRequestDispatcher("/WEB-INF/front/success.jsp").forward(req, resp); return; } req.setAttribute("err", listErr); req.getRequestDispatcher("/err.jsp").forward(req, resp);...

    Spring-for -servletcontext1.0.jar

    Ssh获取ServletContext 只需要更改struts-config action中的type就可以了ru :type="com.uo.spring.SpringDelegatingActionProxy" 大家有什么疑问可以直接去我的blog查看...《[正解]Ssh获取ServletContext》

    servlet2.4doc

    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 ...

    spring web flow demo

    Spring Web Flow 2.0 入门 本教程分析了 Spring Web Flow 2.0 的技术要点,并且通过创建一个示例应用程序,展示了 Spring Web Flow 2.0 的基本知识。 开始之前 关于本教程 本教程通过一个简化的购物车应用,介绍了...

    Spring实战之ServletContextResource访问资源文件示例

    主要介绍了Spring实战之ServletContextResource访问资源文件,结合实例形式分析了spring使用ServletContextResource读取与遍历资源文件相关操作技巧,需要的朋友可以参考下

    sevlet生命周期,request web.xml 及ServletContext总结

    Servlet生命周期,及servlet相关知识点的总结。

    35、servlet--servletContext

    NULL 博文链接:https://onway417.iteye.com/blog/2194540

    ServletContext

    ServletContext代码,开发工具 Myeclipse

    Java-Web-ChatRoom-master.zip

     接收消息:从ServletContext中获取消息,如果不为空则输出消息。 5. 在线人员列表显示功能的实现  将登录进系统的用户与其对应的session存储到一个userMap中,然后显示出来 6. 踢人功能的实现  接收前台传来的...

    servlet中的ServletContext的使用

    这是servlet中ServletContext的应用实例,主要就是添加属性和读取属性。

    ServletContext与ServletConfig关系

    ServletContext与ServletConfig关系

Global site tag (gtag.js) - Google Analytics