问题现象:

最近开始做新需求,然后在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的更多相关文章

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

  2. Spring源码解析 – @Configuration配置类及注解Bean的解析

    在分析Spring 容器创建过程时,我们知道容器默认会加载一些后置处理器PostPRocessor,以AnnotationConfigApplicationContext为例,在构造函数中初始化rea ...

  3. spring ioc 源码分析之-- beanDefinition的加载过程以及ComponentScan,@componet,@import @Bean等注解解析过程

    背景:我们启动主启动类后,相应的bean就被扫描进来了,原理是啥? 实现该功能的主要核心类就是:ConfigurationClassPostProcessor,我们看看他的继承体系: 它实现了Bean ...

  4. org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Can

    org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Can ...

  5. Oracle Net Configuration Assistant failed异常的解决方案

    来自:http://blog.itpub.net/25851087/viewspace-1419440/ 分类: Oracle [环境参数]     Host OS::Win7 32bit     C ...

  6. 项目中运行报错: Loading XML bean definitions from class path resource [applicationContext.xml]

    记录一下: org.springframework.context.support.AbstractApplicationContext prepareRefresh Refreshing org.s ...

  7. Maven Java EE Configuration Problem 的完美解决办法

    背景: 最近在修改项目的时候,发现修改了项目依赖以后会出现如下图:Maven Java EE Configuration Problem 的问题,对于有强迫症的我来说,看到项目上面有个很小的红色小叉号 ...

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

  9. 解决:[INS-20802] Oracle Net Configuration Assistant failed

    在linux 中安装Oracle 11G 的时辰呈现 [INS-20802] Oracle Net Configuration Assistant failed 是oracle数据库的鼓掌,须要补丁p ...

随机推荐

  1. shell常用符号的意义

    转自:http://blog.sina.com.cn/mo0928 感谢原作者!!! 跟網路農夫了解UNIX SHELL-(Bash scripting 简介 第四章 特殊符号) (2007-08-1 ...

  2. Atcoder Grand-014 Writeup

    A - Cookie Exchanges 题面 Takahashi, Aoki and Snuke love cookies. They have A, B and C cookies, respec ...

  3. Redis集群命令行部署工具

    使用之前准备工作: 1)配置好与端口无关的公共redis.conf文件,和工具放在同一目录下 2)配置好与端口相关的模板redis-PORT.conf文件,也和工具放在同一目录下(部署时PORT会被替 ...

  4. 【译】Surface中你也许不知道的五件事

    Bring up the Quick Link Menu - Select the Windows Key + X or right click the Start Button to bring u ...

  5. U盘或者移动银盘退出时一直显示占用中问题解决--最粗暴解决方式

    问题描述: ---------------------------弹出 USB 大容量存储设备 时出问题---------------------------Windows 无法停用“通用卷”设备,原 ...

  6. Qt程序关于路径、用户目录路径、临时文件夹位置获取方法

    比如我们有一个程序在: C:/Qt/examples/tools/regexp/regexp.exe 1. 程序所在目录 QString QCoreApplication::applicationDi ...

  7. js-数组方法push

    <script type="text/javascript">        var arr=[1,2,3,4,5]        arr.push(6,7)      ...

  8. Linux vmstat

    vmstat是Virtual Meomory Statistics(虚拟内存统计)的缩写,可对操作系统的虚拟内存.进程.IO读写.CPU活动等进行监视.它是对系统的整体情况进行统计,不足之处是无法对某 ...

  9. Spark技术的总结 以及同storm,Flink技术的对比

    spark总结 1.Spark的特点: 高可伸缩性 高容错 基于内存计算 支持多种语言:java,scala,python,R 高质量的算法,比MapReduce快100倍 多种调度引擎:可以运行于Y ...

  10. C# Argument 'picture' must be a picture that can be used as an Icon

    Scenario: 创建了一个WinForm的小程序,希望将它显示在任务栏,所以在工具栏中的“公共控件”里,拖入NotifyIcon控件—notifyIcon1,这个是程序运行任务栏右侧通知区域图标显 ...