java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
使用Intellij IDEA 的过程中,新创建的项目启动时报
严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
原因之一jar包未被部署:
ctrl+shift+alt+s打开项目设置窗口,选择Artifacts,选择打包部署项目,选择Output Layout--》Web-INF,查看下面是否有lib目录,右边的jar包是否添加到lib目录下。
详情如下图:
另外,如果使用spring + tomecat 这种架构的话,可能需要考虑对应的各部分的版本:
有文章推荐使用如下搭配,
使用JavaSE1.7+spring3.2.0+facetJava1.7+tomcat7。
使用JavaSE1.8+spring4.1.6+facetJava1.8+tomcat8。
我相信在这些架构搭配上应该会有一个最有的组合,这样形成一个最佳实践,想必会提升效率。
详细请见:
http://blog.csdn.net/wo541075754/article/details/45640267?reload#reply
http://blog.csdn.net/kanshimekan/article/details/52667679