// classpath:META-INF/spring/spring-config.xml
private static ApplicationContext buildApplicationContext(String springConfigPath) {
DefaultResourceLoader resourceLoader = new DefaultResourceLoader();
Resource resource = resourceLoader.getResource(springConfigPath);
if (!resource.exists()) {
throw new IllegalArgumentException("Spring config path: " + springConfigPath + " does not exist!");
} else {
return new GenericXmlApplicationContext(new Resource[] {resource});
}
}