问题描述:java
用eclipse建立一个maven项目中以后,加入了spring有关的依赖,项目运行的时候报Error:configuring application listener of class org.springframework.web.context.ContextLoaderListenerweb
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListenerspring
致使这个问题出现的缘由是在eclipse使用maven编译打包的时候并无把依赖的jar打到web-inf下的lib下,因此才会找不到org.springframework.web.context.ContextLoaderListener。app
解决方案:eclipse
1.右键点击项目--选择Properties,选择Deployment Assembly,在右边点击Add按钮,在弹出的窗口中选择Java Build Path Entries。以下图所示:maven
2.点击Next,选择Maven Dependenciesui
3.点击Finish,而后能够看到已经把Maven Dependencies添加到Web应用结构中了ip
四、而后从新部署项目OKci