首页 > 编程语言> > java.io.FileNotFoundException: class path resource cannot be opened because it does not exist.
java.io.FileNotFoundException: class path resource cannot be opened because it does not exist.
作者:互联网
IDEA+SSM项目构建
问题描述
- 1、部署的时候报错找不到classpath下面的spring/applicationContext.xml文件。
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [spring/applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [spring/applicationContext.xml] cannot be opened because it does not exist
- 2、查看项目目录发现spring/applicationContext.xml文件确实是在classpath下。
- 3、最后发现是因为resources文件夹没有设置为资源文件夹的问题,所以项目创建的时候一定要注意细节!!!!!
解决办法
点击File→Project Structure将resources设置为资源文件夹重新部署即可。
标签:xml,applicationContext,because,resource,opened,spring,path,class 来源: https://blog.csdn.net/YueYingGuang/article/details/95589545