problem
cannot resolve method getBean(java.lang.String)
solution
添加 @Autowired
@Autowiredpublic static void main(String[] args) {
//获取spring上下文对象ApplicationContext context = new ClassPathXmlApplicationContext("beans.xml");Hello hello = (Hello) context.getBean("hello");System.out.println(hello.toString());}