'org.springframework.beans.factory.xml.XmlBeanFactory' is deprecated
XmlBeanFactory这个类已经被摒弃了。可以用以下代替:
ApplicationContext context= new ClassPathXmlApplicationContext("applicationContext.xml");
比如:
XmlBeanFactory factory=new XmlBeanFactory(new ClassPathResource("applicationContext.xml"));
IAopService service=(IAopService) factory.getBean("aopService");
service.withAop();
factory.destroySingletons();
可以修改为:
ApplicationContext context= new ClassPathXmlApplicationContext("applicationContext.xml");
IAopService service=(IAopService) context.getBean("aopService");
service.withAop();