-1

Please help me with to load and parse my spring.xml file using ApplicationContext ap = new ClassPathXmlApplicationContext("resources/spring.xml")

file structure is given in images enter image description here

file and structure

enter image description here

enter image description here enter image description here

enter image description here

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Kailash Choudhary
  • 570
  • 2
  • 7
  • 15

1 Answers1

1

Spring-Context requires Spring-expression and Spring-AOP as compile dependency. you can check required dependencies here.
https://mvnrepository.com/artifact/org.springframework/spring-context/5.0.4.RELEASE

lucid
  • 2,722
  • 1
  • 12
  • 24
  • @KailashChoudhary I cant find spring-expression and spring-aop in the attached image. Maybe attached image is outdated. – lucid Mar 18 '18 at 09:14
  • Is it mandatory for ClassPathXmlApplicationContext ? because it work fine for Resource r = new ClassPathResource("resources/spring.xml"); BeanFactory factory = new XmlBeanFactory(r); – Kailash Choudhary Mar 18 '18 at 14:11
  • Thanks @lucid now its woking , but i want to know why XmlBeanFactory working here – Kailash Choudhary Mar 18 '18 at 14:18
  • check this, https://stackoverflow.com/questions/243385/beanfactory-vs-applicationcontext – lucid Mar 18 '18 at 15:53