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

Viewed 6023

I'm placing applicationContext.xml in the same directory and package as my Java classes.

Doing the following to read it:

ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

Yet I am consistently met with:

IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException

Which I do not get: The file is there, in the same directory as the classes. They're even compiled to /out and I can see it's all there.

I've tried putting it in src/resources/applicationContext.xml but to no avail.

2 Answers
Related