Maven Could not open ServletContext resource [/WEB-INF/applicationContext.xml]

因此:maven中,配置文件的读取应有下列红字两部分,缺一不可。
不是maven项目时,可以都不写。。。。。。。。
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/dispatcher-servlet.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet> <!--spring中唯一的servlet 转发到control层-->
<servlet-name>dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<!--springmvc默认配置的名字:-->
<!--<servlet-name> springMVC<servlet-name> + -servlet-->
<!--设置配置文件-->
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/dispatcher-servlet.xml</param-value>
<!--或<param-value>/WEB-INF/XXX.xml</param-value>-->
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
Maven Could not open ServletContext resource [/WEB-INF/applicationContext.xml]的更多相关文章
- Caused by: java.io.FileNotFoundException: Could not open ServletContext resource [/config/spring/applicationContext.xml]
在搭建SpringMVC框架的时候遇到了这个问题 问题的原因: 就是没有找到applicatoincontext.xml这个文件, 因为idea自动生成的路径不正确 因此需要再web.xml里面, ( ...
- Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/config/springdemo-config.xml]
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML doc ...
- 错误/异常:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/classes/beans_common.xml]...的解决方法
1.第一个这种类型的异常 1.1.异常信息:org.springframework.beans.factory.BeanCreationException: Error creating bean w ...
- IOException parsing XML document from class path resource [WebRoot/WEB-INF/applicationContext.xml];
parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io. ...
- Error creating bean with name 'sqlSessionFactory' defined in class path resource [config/spring/applicationContext.xml]: Invocation of init method failed;
我报的错: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSes ...
- Spring部署报错:Could not open ServletContext resource [/db.properties]
在使用Spring MVC过程中,部署项目报错,报错信息如下: 八月 15, 2016 5:02:04 下午 org.apache.catalina.core.StandardContext list ...
- Sturts2整合Spring报错:org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml];
十一月 17, 2019 1:11:44 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRul ...
- Cannot find class for bean with name '/hello' defined in ServletContext resource
Cannot find class for bean with name '/hello' defined in ServletContext resource [/WEB-INF/chapter2- ...
- 【JAVA错误笔记】 - 【Could not open ServletContext resource [/WEB-INF/applicationContext.xml]解决方法】
错误描述: Could not open ServletContext resource [/WEB-INF/applicationContext.xml] 原因分析: 问题主要由于加载spring的 ...
随机推荐
- securecrt(CRT)导入会话
securecrt是个非常流行的远程管理维护工具,支持fssh.ssh2.telnet等多种协议,也支持中文.设备管理多了,自行手工添加也是很累的活.偷下懒,从别人那复制下文件,倒入到自己的secur ...
- CSS选择器,优先级的总结
CSS选择器 css选择器种类 基本选择器: 通配符选择器 * id选择器 #id 类选择器 .className 元素选择器 E 元素后代选择器 E F 子元素选择器 E > F 相邻兄弟元 ...
- let/const及块级作用域
本系列是在平时阅读.学习.实际项目中有关于es6中的新特性.用发的简单总结,目的是记录以备日后温习:本系列预计包含let/const.箭头函数.解构.常用新增方法.Symbol.Set&Map ...
- 验证客户端的合法性、socketserver模块
一.为了防止客户端被人非法利用,需要在使用之前对客户端进行合法性验证.接下来就是客户端验证的几种方法 hmac 加密方法 import socket import os import hmac #能 ...
- seaborn教程4——分类数据可视化
https://segmentfault.com/a/1190000015310299 Seaborn学习大纲 seaborn的学习内容主要包含以下几个部分: 风格管理 绘图风格设置 颜色风格设置 绘 ...
- hdu 4001 To Miss Our Children Time( sort + DP )
To Miss Our Children Time Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65768/65768 K (Jav ...
- 设置第一个以外的元素样式:not(:first-child),设置最后一个除外的元素样式:not(:last-child)
代码截图:
- elasticsearch 基础 —— 分布式文档存储原理
路由一个文档到一个分片中 当索引一个文档的时候,文档会被存储到一个主分片中. Elasticsearch 如何知道一个文档应该存放到哪个分片中呢?当我们创建文档时,它如何决定这个文档应当被存储在分片 ...
- ubuntu vim8.1编译安装
sudo apt-get install libncurses5-dev python-dev python3-dev libgtk-3-dev libatk1.0-dev libbonoboui2- ...
- liunx-网络基础
liunx 网络配置 ifconfig: ipconfig -a ;显示信息 ifconfig eth1 up //开启网络接口 ifconfig eth1 down //关闭网络接口 ifconf ...