您的位置:首页 > 编程语言 > Java开发

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

2019-04-11 20:33 531 查看

前言

学习三大框架整合过程中,发现一启动 tomcat 控制台就会报错如下:

org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class [org.springframework.web.context.ContextLoaderListener]
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

这里提供一种解决方法。

使用工具:IDEA
tomcat版本:9.0
JDK版本:1.8

解决思路

通过maven依赖添加的包没有到web的lib目录下,所以服务器找不到报错

解决方法

使用快捷键 ctrl+alt+shift+s,召唤出project structure 界面,选择Artifacts

选择自己的项目,在Output Layout界面下,查看自己的项目在web-inf 下是否有lib目录,如果没有新建一个

在右边界面中,选中自己项目名称一样文件夹,右键

选择 put into Output Root

他就会自动把包存放到lib文件下,这时候再启动tomcat,问题就可以解决啦!

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐