Resource resource = new ClassPathResource("../applicationContext.xml"); BeanFactory factory = new XmlBeanFactory(resource);