For my simple maven project this doesn't work:
ApplicationContext context = new ClassPathXmlApplicationContext("config.xml"); config.xml is resided at the same class level
How,actually,add config.xml to classpath? note: my project is a lib,if I do the same in other web project with configuration in web.xml:
<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:config.xml</param-value> </context-param> that it works OK
Here I needn't web.xml, just correct classpath.