Error configuring application listener of class org.springframework.web.context.ContextLoaderListene

项目是Spring+SpringMVC+Mybatis,Maven管理,Tomcat作为web服务器,今天tomcat出了问题,重新下载了一个解压版tomcat,加载进tomcat在编译的时候报错:

Error configuring application listener of class org.springframework.web.context.ContextLoaderListene


这种情况表面看就是缺少Spring的jar包了,既然是Maven项目,那就是说明maven配置有问题了,

第一步 :Window --> Preferences --> Maven --> Installations 查看是否配置了maven,以及是否使用了自己配置的maven

Error configuring application listener of class org.springframework.web.context.ContextLoaderListene


此处我将本地下载的Maven进行了配置,并且选中使用。

如果还是报找不到ContextLoaderListener

第二步:选中项目或者项目的web模块(我是Java工程转web工程的,web模块为webapp),右键选择 Properties --> Deployment Assembly查看是否引入了

Error configuring application listener of class org.springframework.web.context.ContextLoaderListene


没有引入的话,点击 Add --> Java Build Path Entries --> Maven Dependencies --> Finish --> Apply --> Add添加Maven Dependencies,然后重启服务,正常启动。


Error configuring application listener of class org.springframework.web.context.ContextLoaderListene