Reputation: 67
I am working on an introduction to spring course, but I have an issue with my SpringConfig.xml
file path. As show on the picture, I just added it everywhere as a hailmary but that's not working either:
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [SpringConfig]; nested exception is java.io.FileNotFoundException: class path resource [SpringConfig] cannot be opened because it does not exist
My path:
Main method code:
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("SpringConfig");
}
Upvotes: 1
Views: 112
Reputation: 7077
please don't forget to add the file extension ".xml", spring will read it from src/main/resource
public static void main(String[] args) {
ApplicationContext context = new ClassPathXmlApplicationContext("SpringConfig.xml");
}
Upvotes: 1