当前位置:   article > 正文

fileoutputstream 文件不存在_Spring问题之提示文件不存在处理it does not exist

java fileoutputstream 保存文件时文件夹不存在

Spring问题:class path resource [org.springapplicationContext.xml] cannot be opened。

Spring问题:org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring/root-context.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/root-context.xml] cannot be opened because it does not exist 。

字面意思是:spring路径下的root-context.xml文件不存在!这个就有点扯了。web.xml配置的没有问题,文件也是确实存在的。如果是用IDEA开发的话,会看到这行配置是红色警告的,当时没有注意。

4a7fe4ed750b0c1c3f42e64939511142.png

怀疑没有把该目录加进来,资源没有被加载编译。选中项目,选择Open Module Settings,果然没有,选择红框Resources添加整个目录。

7112ce887b83958bbefee4777592ace8.png

添加后的如下,完成!启动后没有报错,完美!

a61d3eeb4fd1a2c29452251cccaf1b3b.png
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/898664
推荐阅读
相关标签
  

闽ICP备14008679号