parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist

翻译:解析来自类路径资源的XML文档[applicationContext.xml];嵌套的异常io。FileNotFoundException:类路径资源[applicationContext]。xml不能打开,因为它不存在

这个是我遇到的问题,因为太粗心把applicationContext.xml文件放在了src下的包中,所以报错没有找到;放在src下面的,就不会报错,执行通过

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

下面是我在网上看到其他人的错误解决办法,可能小伙伴们会用到就转载了过来,用到的可以参考一下

IOException parsing XML document from class path resource [WebRoot/WEB-INF/applicationContext.xml];

翻译:从类路径IOException解析XML文档资源(WebRoot / web - inf /中);

java之spring

问题:用junit做测试的时候,无法获取到applicationContext.xml配置文件【这里的配置文件是放在WEB-INF下面的,如果是放在src下面的,就不会报这个错】

写法:ClassPathXmlApplicationContext ac=new ClassPathXmlApplicationContext("/WebRoot/WEB-INF/applicationContext.xml");

修改方法:用下面这种方式就可以获取

FileSystemXmlApplicationContext ac=new FileSystemXmlApplicationContext("/WebRoot/WEB-INF/applicationContext.xml");

转:http://blog.csdn.net/wxl1990721/article/details/9196101

IOException parsing XML document from class path resource [WebRoot/WEB-INF/applicationContext.xml];的更多相关文章

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

  2. 【异常】IOException parsing XML document from class path resource [xxx.xml]

    1.IDEA导入项目运行出现异常 org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing ...

  3. parsing XML document from class path resource

    遇到问题:parsing XML document from class path resource [spring/resources] 解决方法:项目properties— source—remo ...

  4. parsing XML document from class path resource [config/applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [config/applicationContext.xml] 解决方案

    parsing XML document from class path resource [config/applicationContext.xml]; nested exception is j ...

  5. parsing XML document from class path resource [applicationtext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationtext.xml] cannot be opened because it does not e

    控制台异常: parsing XML document from class path resource [applicationtext.xml]; nested exception is java ...

  6. MyBatis笔记----报错:Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/ij34/mybatis/applicationContext.xml]: Invocation of init method failed; nested exception is org.sp

    四月 05, 2017 4:51:02 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRef ...

  7. MyBatis笔记----(2017年)最新的报错:Cannot find class [org.apache.commons.dbcp.BasicDataSource] for bean with name 'dataSource' defined in class path resource [com/ij34/mybatis/applicationContext.xml]; nested e

    四月 05, 2017 4:56:11 下午 org.springframework.context.support.ClassPathXmlApplicationContext prepareRef ...

  8. java.io.FileNotFoundException: class path resource [bean/test/User.hbm.xml] cannot be opened because it does not exist

    确定下 WEB-INF/classes下有没有,不是src下哦 工程的src下创建后,会发布到tomcat下项目下的classes中

  9. SSH applicationContext.xml import异常

    近期在项目上,遇到了一个问题.在配置applicationContext.xml使用<import>标签引入其他的xml文件时,导致项目启动时过慢.有时还会引起启动异常.后来查到是xml文 ...

随机推荐

  1. Spring Boot(一):入门篇

    Spring Boot(一):入门篇 一.Spring Boot介绍 Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程. 该框架 ...

  2. python简说(二十七)sys.argv

    sys.argv,是获取到运行python文件的时候传入的参数 可以在pycharm中点击 if len(sys.argv)>1: if sys.argv[1]=='--help': quit( ...

  3. fatal: [db01]: FAILED! => {"changed": false, "msg": "The PyMySQL (Python 2.7 and Python 3.X) or MySQL-python (Python 2.X) module is required."}

    centos7.5 使用ansible中的role安装mariadb创建用户报错 错误: [root@m01 roles]# ansible-playbook site.yml TASK [mysql ...

  4. Bootstrap3基础 nav 便签页(横版、竖版)

      内容 参数   OS   Windows 10 x64   browser   Firefox 65.0.2   framework     Bootstrap 3.3.7   editor    ...

  5. Restful framework【第一篇】RESTful 规范

    什么是RESTful REST与技术无关,代表的是一种软件架构风格,REST是Representational State Transfer的简称,中文翻译为“表征状态转移” REST从资源的角度类审 ...

  6. A successful Git branching model——经典篇

    A successful Git branching model In this post I present the development model that I’ve introduced f ...

  7. mysql表分区存储过程

    本文为博主原创,未经允许不得转载: 由于数据库一张表数据量有几千万条,而且在不断增长,看见公司前辈写了一个创建表分区的存储过程,感觉 甚是牛逼,在此供自己保留学习. /*PROCEDURE creat ...

  8. Latex citation using natbib and footnotesize

    References: Natbib bibliography styles How to change font size for bibliography? Latex citation usin ...

  9. Mac python 2.X 升级到 3.X

    Mac OS X10.9默认带了Python2.7,不过现在Python3.3.3出来了,如果想使用最新版本,赶紧升级下吧.基本步骤如下. 第1步:下载Python3.3 下载地址如下: Python ...

  10. 正则解析json数据

    http://tool.chinaz.com/regex http://tool.oschina.net/regex/