运行tomcat出现
IOException parsing XML document from class path resource [WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: class path resource [WEB-INF/applicationContext.xml] cannot be opened because it does not exist
意思是applicationContext.xml 没有找到。 有3个原因导致这个bug
1、applicationContext.xml配置文件没有配置好
2、没有将applicationContext.xml放在resource目录下
3、resource目录没有设置为资源目录
4、out文件夹里没有applicationContext.xml 这个文件,解决方法是:复制一份applicationContext.xml到out文件目录下的classes里面去就可以了。
5、out文件夹里有applicationContext.xml 这个文件,web.xml 文件中,applicationContext.xml
的classpath地址出现错误,这个是我遇到的错误。