FileNotFoundException while importing a spring xml file

1909 views java

I have the following line in one of my xml file to include the spring.xml file located at src/main/resources/config of my maven project.

<import resource="classpath:config/spring.xml"/> 

I have the location src/main/resources in my build path. Despite this while running it. It is giving the below exception

Caused by: class path resource [spring.xml] cannot be opened because it does not exist
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(
... 13 more

Below is the build path source tab

enter image description here

src/main/resources/ :

enter image description here

answered question

1 Answer


Try to put / before config. Like this:


EDIT: Put the Excluded of resources path to (None) and Included: (All)

posted this

Have an answer?


Please login first before posting an answer.