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

java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

2017-05-03 15:14 344 查看
在初次使用SpringMVC编写HelloWorld的时候,运行时报这个错误,在网上搜索一顿基本都是说jar包是否导入或者tomcat的缓存是否清除的问题,然而我的问题定位貌似都不是,最后在
stackoverflow
上看到如下的答案:

I used IntelliJ IDEA, compilation is successful, but when starting Tomcat, it says:

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


Solution:
File > Project Structure > Artifacts
, in the Output Layout double click in right panel
Available Elements
the library named like
Maven:...
, it will be moved to WEB-INF/lib in the left pane.

Accept and restart Tomcat.

这个回答完美的结局了我的问题,就是在如下图中:





将Output Layout中右边的Available Elements中的可用jar包双击,就能将该jar包导入WEB-INF中的lib中了,我用的是IntelliJ IDEA,这个问题就这样解决了,其他的问题还需再自行搜索解决了!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐