错误如下: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from resource [/WEB-INF/applicationContext.xml] of ServletContext; nested exception is java.io.FileNotFoundException: Could not open resource [/WEB-INF/applicationContext.xml] of ServletContext java.io.FileNotFoundException: Could not open resource [/WEB-INF/applicationContext.xml] of ServletContext
原因: 加载spring的配置文件时在默认位置/WEB-INF/下找不到applicationContext.xml文件,看了下,myeclipse自动生成的applicationContext.xml放在/WEB-INF/classes下,难怪找不到,终于发现问题了,下面在web.xml中做如下配置即可解决: contextConfigLocation /WEB-INF/classes/applicationContext.xml