0
votes

Error : Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from class path resource [applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [applicationContext.xml] cannot be opened because it d

Code:

ClassPathXmlApplicationContext context=new ClassPathXmlApplicationContext("applicationContext.xml");
2
Hello Raj, it appears that the issue is likely application context can not be established. Can you please post the code as well? Many things could cause this. - tbauer428
Are you using spring boot? Either way, make sure applicationContext.xml is under src/main/resources and you import it in a @Configuration file using @ImportResource({"classpath*:applicationContext.xml"}) - Sunil Dabburi

2 Answers

0
votes

Make sure you have the xml configuration file applicationContext.xml in your project resources path.

0
votes

ApplicationContext.xml file should be in classpath. Kindly keep applicationContext.xml in src as you are using ClassPathXmlApplicationContext class for loading applicationContext.xml file

hope it will be helpful to you