My applicationContext is placed at path:src\main\webapp\WEB-INF\conf\applicationContext.xml
When I build this web application.I can see that conf folder is placed at {projectname.war}\WEB-INF\conf\applicationContext.xml.And Application works fine.
Now I happened to write a class with public static void main where I am trying to load applicationCOntext using below:
ApplicationContext context = new ClassPathXmlApplicationContext("../conf/applicationContext.xml");
ClassPathXmlApplicationContext("/WEB-INF/conf/applicationContext.xml"); ClassPathXmlApplicationContext("applicationContext.xml"); none of above seems to be working. error is listed below:
Caused by: java.io.FileNotFoundException: class path resource [../conf/applicationContext.xml] cannot be opened because it does not exist.
Can someone point what wrong I am doing ?