Caused by: java.io.FileNotFoundException: class path resource [applicationContext.] cannot be opened

idea的spring项目碰到了,我的问题是路径问题。一般来说有两个方面的错误,

一是不仔细,打错了,“applicationContext.xml”,别少打了什么。

二是路径问题了,在idea中的spring配置文件要放在resources目录下。

 

Caused by: java.io.FileNotFoundException: class path resource [applicationContext.] cannot be opened

如图:。如果没有就新建一个目录,将其设置为resources root。

Caused by: java.io.FileNotFoundException: class path resource [applicationContext.] cannot be opened

如图。

Caused by: java.io.FileNotFoundException: class path resource [applicationContext.] cannot be opened