Configuration problem: Failed to import bean definitions from relative location
问题现象:
最近开始做新需求,然后在Tomcat上部署项目时,出现了如下报错:
[12-05 09:54:27,161 ERROR] ContextLoader.java:351 - Context initialization failed
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from relative location [spring-controller-slave.xml]
Offending resource: class path resource [spring.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from URL [file:/E:/java/tomcat/apache-tomcat-8.5.31/webapps/ROOT/WEB-INF/classes/spring-controller-slave.xml]; nested exception is java.io.FileNotFoundException: E:\java\tomcat\apache-tomcat-8.5.31\webapps\ROOT\WEB-INF\classes\spring-controller-slave.xml
具体就是IO解析错误,无法解析XML文件,
IOException parsing XML document from class path resource [file:/E:/java/tomcat/apache-tomcat-8.5.31/webapps/ROOT/WEB-INF/classes/spring-controller-slave.xml]
问题分析:
这个问题是概率性出现的,文件是存在的,但是还是报错了,怀疑是Tomcat缓存问题。
于是清除了Tomcat缓存,clean了项目,甚至update了maven项目,然后再启动tomcat,有概率性成功;如果还是失败,就在Tomcat发布项目的地方,将发布项目的文件夹删除,然后重新clean,一般来说,就会成功了。
这个问题虽然这样可以解决,但具体的原理还是不清楚,待以后慢慢研究,先记下再说。
最终发现是编译后的target文件夹里面里面缺少xml文件导致的,
最简单的就是手动copy缺少的xml文件进去重启tomcat解决
Configuration problem: Failed to import bean definitions from relative location的更多相关文章
- org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unexpected failure during bean definition parsing Offending resource: class path resource [applicationC
这个错误是 org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration proble ...
- Spring源码解析 – @Configuration配置类及注解Bean的解析
在分析Spring 容器创建过程时,我们知道容器默认会加载一些后置处理器PostPRocessor,以AnnotationConfigApplicationContext为例,在构造函数中初始化rea ...
- spring ioc 源码分析之-- beanDefinition的加载过程以及ComponentScan,@componet,@import @Bean等注解解析过程
背景:我们启动主启动类后,相应的bean就被扫描进来了,原理是啥? 实现该功能的主要核心类就是:ConfigurationClassPostProcessor,我们看看他的继承体系: 它实现了Bean ...
- org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Can
org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Can ...
- Oracle Net Configuration Assistant failed异常的解决方案
来自:http://blog.itpub.net/25851087/viewspace-1419440/ 分类: Oracle [环境参数] Host OS::Win7 32bit C ...
- 项目中运行报错: Loading XML bean definitions from class path resource [applicationContext.xml]
记录一下: org.springframework.context.support.AbstractApplicationContext prepareRefresh Refreshing org.s ...
- Maven Java EE Configuration Problem 的完美解决办法
背景: 最近在修改项目的时候,发现修改了项目依赖以后会出现如下图:Maven Java EE Configuration Problem 的问题,对于有强迫症的我来说,看到项目上面有个很小的红色小叉号 ...
- Oracle12c client安裝報錯[INS-20802] Oracle Net Configuration Assistant failed完美解決
Doc ID 2082662.1 1.錯誤碼 Installation Of Oracle Client 12.1.0.2.0 (32-bit) Fails With An Error Message ...
- 解决:[INS-20802] Oracle Net Configuration Assistant failed
在linux 中安装Oracle 11G 的时辰呈现 [INS-20802] Oracle Net Configuration Assistant failed 是oracle数据库的鼓掌,须要补丁p ...
随机推荐
- Effective C++ 随笔(4)
条款21:必须返回对象时,别妄想返回其reference 例子: Raional类可以执行有理数的一些运算,并且使用heap内存申请 并且其operator*函数为 const Rational&am ...
- js格式化文件大小, 输出成带单位的字符串工具
/** * 格式化文件大小, 输出成带单位的字符串 * @method formatSize * @grammar formatSize( size ) => String * @grammar ...
- reload maven project' has encountered a proble" 问题
由于重重原因,我取消maven的下载(可能是jar包没有公服镜像).导致重新打开sts 时发生异常. 在网上寻找到资料,发现需要删除${workspace}\.metadata\.plugins\or ...
- 【ORA错误大全】 ORA-19527
在做主备切换的时候,需要将备库的联机日志文件清除(clear online redo logfile),为了加快switchover的速度,Oracle10g在将备库置于manged standby状 ...
- web百度地图跨域问题
//根据经纬度获取地理位置信息function latOrLng(sLat, sLng) { var resUrl = 'http://api.map.baidu.com/geocoder/v2/?a ...
- Update Node.js Package.json
Update the latest package while using node.js, follow the command as following. npm i -g npm-check-u ...
- QOpenGLFunctions的相关的使用(1)
QOpenGLFunctions的使用 1. QOpenGLFunctions 说明 QOpenGLFunctions 类提供了跨平台的OpenGl ES2.0 API版本. OpenGL 2. ...
- PCB中实现元器件旋转一个角度放置
我们常常放置器件都是横着或者竖着的...但是有时候需要器件能旋转一个角度放更方便的话,可以这样 设置器件的属性.....
- KNIME + Python = 数据分析+报表全流程
Python 数据分析环境 数据分析领域有很多可选方案,例如SPSS傻瓜式分析工具,SAS专业性商业分析工具,R和python这类需要代码编程类的工具.个人选择是python这类,包括pandas,n ...
- linux上安装python2.7.11
好久不玩儿linux了,本来就不熟,现在几乎白痴.步骤如下: 从python官网上下载python的源代码 tar zvxf后得到一个文件夹: 进入Python-2.7.11,按照https://do ...