首先检查你的配置文件名: ApplicationContext ac = new ClassPathXmlApplicationContext("applicationContext.xml"); 接下来这一点是我的error: 打包方式不能是pom 修改为:war或者jar 完成!!