报错
IOException parsing XML document from class path resource [bean.xml]; nested exceptionis java.io.FileNotFoundException: class path resource [bean.xml] cannot be opened because it does not exist
ApplicationContext context=new ClassPathXmlApplicationContext("bean.xml");
出现这个问题的原因是找不到配置文件bean.xml
解决
我们将我们的xml文件放在src目录下面就可以了,不要放在文件包里面。