class path resource [springMVC-servlet.xml] cannot be opened because it does not exist
SpringMVC web项目启动报错:
严重: Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [springMVC-servlet.xml]; nested exception isjava.io.FileNotFoundException: class path resource [springMVC-servlet.xml] cannot be opened because it does not exist
这里写一下有关DispatcherServlet前端控制器配置文件的编写和存放位置
1、servlet标签下的init-param标签是为配置文件指定新的位置,如果配置文件xxx-servlet在默认配置文件下即在WEB-INF下就尽量不要配init-param了,配置反而会出错
2、如果是配置文件放在WEB-INF默认读取地址需要遵循xxx-servlet.xml的命名格式;且xxx要和servlet-name>springMVC</servlet-name 里的值一样
3、如果没把配置文件xml放在默认目录下(WEB-INF),就配上init-param,告诉服务器去哪找配置文件;此时的配置文件名可以自己定义
web.xml中
<servlet><servlet-name>springMVC</servlet-name><servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class><!-- 为配置文件指定新的位置,如果配置文件xxx-servlet在默认配置文件下即WEB-INF下就尽量不要配了,配置反而会出错 --><!-- <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:springMVC-servlet.xml</param-value> </init-param> --><load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping><servlet-name>springMVC</servlet-name><url-pattern>/</url-pattern>
</servlet-mapping>
class path resource [springMVC-servlet.xml] cannot be opened because it does not exist相关推荐
- class path resource [a.hbm.xml] cannot be opened because it does not exist
大家好,我是mythSun. 很高兴能在这里和大家分享,怎么来解决 class path resource [a.hbm.xml] cannot be opened because it does n ...
- 关于class path resource [mapper/*Mapper.xml] cannot be opened because it does no exists
关于class path resource [mapper/*Mapper.xml] cannot be opened because it does no exists异常的一些记录 这是用spri ...
- java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be opened
一般来说路径问题. 我检查了web.xml的行,发现我设置的是固定的springmvc,但我实际命名为springMVC,当然报错. 其实报错了通过耐心翻译很容易看出问题,path resource ...
- nested exception is java.io.FileNotFoundException: class path resource [springmvc.xml] cannot be ope
根据 提示 ,逐步解决bug,逐层推进:比如,有一个错是IOException异常,Springmvc.xml找不到,就需要去找下是否有配置文件,如果有,怎么回事?第二次再深入发现是target下没有 ...
- 报错解决:IOException parsing XML document from class path resource [spring-mvc.xml]
今天在创建一个springmvc的项目的时候,我碰到了页面上的报错: IOException parsing XML document from class path resource [spring ...
- Web开发:class path resource [com/xxx/entity/User.hbm.xml] cannot be opened because it doesn't exist
1 前言 最近在教人使用SpringMVC,在运行过程中,有不少人遇到了这个问题,即"class path resource [com/xxx/entity/User.hbm.xml] ca ...
- class path resource [beans.xml] cannot be opened because it does not exist
严重: Exception sending context initialized event to listener instance of class org.springframework.we ...
- Error creating bean with name 'dataSource' defined in class path resource [spring/spring-dao.xml]:
Error creating bean with name 'dataSource' defined in class path resource [spring/spring-dao.xml]: B ...
- Line 8 in XML document from class path resource [conf/applicationContext.xml] is invalid
@[TOC**] 错误:Line 8 in XML document from class path resource [conf/applicationContext.xml] is invalid ...
- 关于sping使用springSecurity权限控制:Offending resource: class path resource [spring/spring-security.xml错误整理
严重:Exception sending context initialized event to listener instance of class org.springframework.web ...
最新文章
- bzoj 2946 [Poi2000]公共串——后缀自动机
- cesium多边形描边_Cesium专栏-地形开挖2-任意多边形开挖(附源码下载)
- CS231n 2016 通关 第三章-SVM 作业分析
- PHP 实现代码复用的一个方法 traits新特性
- C# Datatable排序与取前几行数据
- iPhone手机更换自定义铃声
- Makefile中关于all和.PHONY
- 哥廷根大学计算机博士,德国哥廷根大学 单分子光学 招博士 (75% TV-L E13 工资)...
- CISCO常用配置命令
- 大数据资料和开发工具
- 中文分词(上)——获取和Word2Vec模型构建
- Unity面试题加强版之三《Unity脚本基础》
- matlab图像编码实验,数字图像处理实验和matlab程序代码数字图像处理实验.doc
- kaggle:NBA球员投篮数据分析与可视化(一)
- cost的导函数_几种常见函数的导数
- Springboot上传文件时提示405
- FZU1901 Period II
- 使用matla求取一维线性函数的系数
- 我国电子计算机诞生于,我国第一台电子计算机诞生于哪一年.doc
- 三大统计学相关系数(pearson皮尔森、spearman斯皮尔曼、kendall肯德尔)
热门文章
- 真机调试错误 Reason: image not found想到的
- android开发 问卷调查案例_基于Android的问卷调查系统模型分析与设计
- cocos2dx 3.9.1 mac模拟器log输出bug修正
- Python web客户端编程简单示例
- 黑帆第一季/全集Black Sails迅雷下载
- Virtual-Taobao: Virtualizing Real-World Online Retail Environment for Reinforcement Learning
- Linux网卡bond
- 常用标点符号中英文对照表
- 【Python军火库】smtplib+email:一起来用Python发送电子邮件吧!
- 4 款超级好用的终端文件管理器,提高你的使用效率!