java.lang.ClassNotFoundException:org.springframework.web.context.ContextLoaderListener问题解决

今天搭建SSH项目的时候出现了例如以下错误:

严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener 
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

网上查了一下。有些人说是没有spring的相关包。可是我检查这个包确实有进行依赖的。

双击web.xml的“org.springframework.web.context.ContextLoaderListener”也能跳转到相应class文件中面。显然并非缺少包的原因。

后面也花了挺长时间也没有解决,偶然在某篇博客的评论发现了解决方式。假设各位猿友也是使用maven的话能够试试例如以下解决方式:

事实上可能是你的jar文件没有同步公布到自己项目的lib文件夹中(假设你是用Maven进行构建的话) 能够试试 以下的办法 项目点击右键 点击 Properties 选择Deployment Assembly 再点击右边的Addbutton 选择Java Build Path Entries后点击Nextbutton 然后选择你的Maven Dependencies 确定就可以。

原文地址:https://www.cnblogs.com/claireyuancy/p/7226197.html