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

Posted fengyanqing

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

找不到文件

技术图片

 

 

 

 

 1.查看项目资源目录,applicationContext.xml  位于conf下

 

 

技术图片

 

 

2.查看applicationContext.xml 的配置

技术图片

 

 3.查看项目classpath配置,没有配置conf路径

技术图片

 

 4.添加conf路径到classpath中,问题解决

技术图片

 

 

 

总结,一般文件找不到,跟classpath有关,检查classpath中有没有资源文件所在的目录,没有则加入;

以上是关于class path resource [applicationContext.xml] cannot be opened because it does not exist的主要内容,如果未能解决你的问题,请参考以下文章

单点登录-----遇到问题-----FileNotFoundException: class path resource-UsernamePasswordWrapperAuthenticatio(代码

异常IOException parsing XML document from class path resource [xxx.xml]

Error creating bean with name ‘redisConnectionFactory‘ defined in class path resource...

Error creating bean with name ‘redisConnectionFactory‘ defined in class path resource...

SpringBoot Error creating bean with name 'dataSource' defined in class path resource。。。

报错 Error creating bean with name ‘elasticsearchTemplate‘ defined in class path resource