BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource
Tomcat报错如下:
BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource
错误原因:
Tomcat在解析xml时,找不到相应的资源.
解决方法:
如果applicationContext.xml放在src文件下面,则在web.xml中加上:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:applicationContext.xml</param-value>
</context-param>
如果applicationContext.xml放在WEB-INF下面,则在web.xml中加上
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/applicationContext.xml</param-value>
< /context-param>
此外,如果在类中通过ClassPathXmlApplicationContext获取context,则必须把applicationContext.xml直接放在src文件下。
ApplicationContext context= new ClassPathXmlApplicationContext("applicationContext.xml");
如果applicationContext.xml放在其他路径下,可以用FileSystemXmlApplicationContext通过绝对路径实例化context.
BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource的更多相关文章
- 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 ...
- ERROR [localhost-startStop-1] - Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/ap
ERROR [localhost-startStop-1] - Context initialization failed org.springframework.beans.factory.Bean ...
- 出错: IOException parsing XML document from ServletContext resource [/cn.mgy.conig]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/cn.mgy.conig]
错误的详细内容: 严重: StandardWrapper.Throwable org.springframework.beans.factory.BeanDefinitionStoreExceptio ...
- IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/app
web.xml初始化spring容器出错 org.springframework.beans.factory.BeanDefinitionStoreException: IOException par ...
- IOException parsing XML document from ServletContext resource
错误是我们学习的机会,不要错过明白明这个错误原因的机会,那么我们就可以更加深刻得理解这个问题. 在启动springmvc的程序去访问的时候,报IO异常,一般情况下IO异常就是文件找不到. 详细错误如下 ...
- org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: c
//这个是 配置文件放错了地方 org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing ...
- Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/config/springdemo-config.xml]
org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML doc ...
- 【异常】IOException parsing XML document from class path resource [xxx.xml]
1.IDEA导入项目运行出现异常 org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing ...
- 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. ...
随机推荐
- 从Qt谈到C++(一):关键字explicit与隐式类型转换
转载:果冻虾仁 提出疑问 当我们新建了一个Qt的widgets应用工程时.会自动生成一个框架,包含了几个文件. 其中有个mainwindow.h的头文件.就是你要操纵的UI主界面了.我们看看其中的一段 ...
- linux 守护进程 daemon
Linux的Service/Daemon你真的懂了吗? Linux 守护进程的启动方法 linux系统编程之进程(八):守护进程详解及创建,daemon()使用 linux守护进程 daemon 详解
- python selenium-7自动发送邮件
https://jingyan.baidu.com/article/647f0115b78f8d7f2148a8e8.html 1.发送HTML格式的邮件 import smtplib from em ...
- shell 1基础
shell简介 shell是一个用C语言编写的程序,是用户使用Linux的桥梁.shell既是一种命令语言,又是一种程序设计语言. shell脚本(shell script),是一种为shell编写的 ...
- 1077 Kuchiguse (20 分)
1077 Kuchiguse (20 分) The Japanese language is notorious for its sentence ending particles. Personal ...
- tsql 循环id读取
declare @IDList as varchar(max) declare @ID as int declare @i as int set @IDList='' )) + ',' from ta ...
- 解决IE下select标签innerHTML插入option的BUG(兼容
在ie下面使用innerHTML来插入option选项的话,ie会去掉前面的<option>,并拆分成多个节点,这样会造成select的出错 前言: 这是一个老bug了,现在提供一个完 ...
- 2015ACM-ICPC长春E题(hdu5531)题解
一.题意 No response.T_T 二.思路 分$n$为奇数或者偶数讨论. 如果$n$是奇数,列出不等式组:$r_1+r_2=d_{1},r_2+r_3=d_{2},r_3+r_4=d_{3}, ...
- Maven web项目启动出错
问题描述: 在第一次建立maven项目后,启动测试,结果jsp页面报告404错误 问题解决: 在pom.xml中引入servlet-api 和 jsp-api,maven不会自动的添加,因此,要在首次 ...
- 第8章 信号(1)_Linux信号处理机制
1. 信号的基本概念 1.1 基本概念 (1)信号(signal)机制是linux系统中最为古老的进程之间的通信机制,解决进程在正常运行过程中被中断的问题,导致进程的处理流程会发生变化. (2)信号本 ...