JAVA Spring报错 (1)

来源:互联网 发布:单身 快乐 知乎 编辑:程序博客网 时间:2024/06/05 15:29

这里写图片描述

ApplicationContext  ac = new ClassPathXmlApplicationContext("applicationContext.xml");`

ApplicationContext ctx = new ClassPathXmlApplicationContext();
时,没有指定配置文件,Spring实例化BeanFactory的时候是默认到classPath下面查找名为applicationContext.xml的文件的,这就是错误的原因,在括号写上配置文件名就行了。

原创粉丝点击