class path resource [applicationContext.xml] cannot be opened because it does not exist

仓廪实则知礼节,衣食足则知荣辱。这篇文章主要讲述class path resource [applicationContext.xml] cannot be opened because it does not exist相关的知识,希望能为你提供帮助。
今天给游戏管理端添加新功能,启动时报错
Caused by: java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it does not exist
找不到文件

class path resource [applicationContext.xml] cannot be opened because it does not exist

文章图片

 
 
 
 
  1.查看项目资源目录,applicationContext.xml  位于conf下
 
 
class path resource [applicationContext.xml] cannot be opened because it does not exist

文章图片

 
 
2.查看applicationContext.xml 的配置
class path resource [applicationContext.xml] cannot be opened because it does not exist

文章图片

 
  3.查看项目classpath配置,没有配置conf路径
class path resource [applicationContext.xml] cannot be opened because it does not exist

文章图片

 
  4.添加conf路径到classpath中,问题解决
class path resource [applicationContext.xml] cannot be opened because it does not exist

文章图片

 
 
 
【class path resource [applicationContext.xml] cannot be opened because it does not exist】总结,一般文件找不到,跟classpath有关,检查classpath中有没有资源文件所在的目录,没有则加入;

    推荐阅读