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下。
    java.io.FileNotFoundException: class path resource cannot be opened because it does not exist.
  • 3、最后发现是因为resources文件夹没有设置为资源文件夹的问题,所以项目创建的时候一定要注意细节!!!!!

解决办法

点击File→Project Structure将resources设置为资源文件夹重新部署即可。
java.io.FileNotFoundException: class path resource cannot be opened because it does not exist.

上一篇:OCP-1Z0-053-V13.02-712新题


下一篇:HTML5 because its MIME type ('text/html') is not a supported stylesheet MIME type, and str