Spring常见有关问题整理(持续更新)

Spring常见问题整理(持续更新)1.常见错误一控制台输出:ApplicationContext context new ClassPathXmlApp

Spring常见问题整理(持续更新)
1.常见错误一
控制台输出:

ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml"); UserManagerImpl userManagerImpl = (UserManagerImpl) getBean("userManager"); 

当通过上面代码调用类方法时,需要特别注意,Spring只能对接口AOP,此处UserManagerImpl类应该为接口,而不是接口的实现类。