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

what?????

请听本君道来。

我只是移动了applicationContext的位置从src根目录下到src下的config文件夹中,并且已经在 ClassPathXmlApplicationContext("config/applicationContext.xml") 方法中做了更改,可是并没有什么卵用,当我把applicationContext.xml文件移动到src的根目录下时,并更改为ClassPathXmlApplicationContext("applicationContext.xml")又可以运行了。

经过洋哥不断的google,终于找到了解决方案:

  当applicationContext.xml不在src根目录下时,那么在对应的ClassPathXmlApplicationContext()方法中要在对应的路径前加上 'file:' ,如:

至于为什么要这样,大家感兴趣的可以自己百度。三克油

parsing XML document from class path resource [config/applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [config/applicationContext.xml] 解决方案的更多相关文章

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

  2. 出错: 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 ...

  3. nested exception is java.io.FileNotFoundException: class path resource [spring/spring-datasource-mog

    spring单元測试时发现的问题: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsin ...

  4. nested exception is java.io.FileNotFoundException: class path resource [jdbc.properties] cannot be opened because it does not exist

    Could not load properties; nested exception is java.io.FileNotFoundException: class path resource [j ...

  5. nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist

    org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession. ### The error may ...

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

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

  8. 解决CXF的java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-soap.xml] cannot be opened because it does not exist

    以下是错误信息 九月 25, 2017 8:22:04 下午 org.springframework.web.context.support.XmlWebApplicationContext prep ...

  9. Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be ope

    1.错误描述 java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.tes ...

随机推荐

  1. gitlab 远程 定时备份

    =============================================== 2017/11/1_第2次修改                       ccb_warlock 更新 ...

  2. 通过js添加的元素点击事件无法触发

    var blk_have ='<div class="sw-off"></div>'; $('#blk').prepend(blk_have); $(doc ...

  3. vim编辑器的使用技巧

    vim(vi)是上Linux非常常用的编辑器,很多Linux发行版都默认安装了vi(vim).vi(vim)命令繁多但是如果使用灵活之后将会大大提高效率.vi是“visual interface”的缩 ...

  4. jq 中each的用法 (share)

    each的使用方法 在jQuery里有一个each方法,用起来非常的爽,不用再像原来那样写for循环,jQuery源码里自己也有很多用到each方法.其实jQuery里的each方法是通过js里的ca ...

  5. 进程管理工具htop/glances/dstat的使用

    进程管理工具htop/glances/dstat的使用 Linux中进程的相关知识 1.什么是进程呢? 通俗的来说进程是运行起来的程序.唯一标示进程的是进程描述符(PID). 2.进程的分类 1)根据 ...

  6. @EnableAsync annotation metadata was not injected

    [问题描述] @EnableAsync annotation metadata was not injected spring配置初始化时候报错 nested exception is java.la ...

  7. IOS10.3上传照片只能拍照不能选择解决办法

    升级IOS10.3正式版以后可能会出现上传文件的控件只能拍照而不能选择现有图片的问题. 正好被我们碰到了,于是找了找解决思路,发现如下解决思路: 原代码为: <input type=" ...

  8. visual studio各种新建项目和新建项简介

    一.新建项目 二.新建项 用户控件和自定义控件的区别 1.WinForm中的用户控件继承自 UserControl,主要用于开发 Container 控件,Container控件可以添加其他Contr ...

  9. Mysql查询不为null值

    Mysql本以为查询不为null就是!=null可是结果查询出来什么都没有,后来才发现不为null应该是is not null ,为null应该是is null.

  10. 【最大权闭合子图】bzoj4873 [Shoi2017]寿司餐厅

    4873: [Shoi2017]寿司餐厅 Time Limit: 20 Sec  Memory Limit: 512 MBSubmit: 369  Solved: 256[Submit][Status ...