idea启动web, 报:java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
关于使用IDEA调试springmvc项目,出现:
[RMI TCP Connection(2)-127.0.0.1] org.apache.catalina.core.StandardContext.listenerStart Error configuring application listener of class org.springframework.web.context.ContextLoaderListenerjava.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1285)错误解决方案。
实际在Idea中这样配置:
File > Project Structure > Artifacts > 在右侧Output Layout右击项目名,选择Put into Output Root,见下面截图:
执行后,在WEB-INF在增加了lib目录,里面是项目引用的jar包,点击OK。
重新启动Tomcat,这次成功发布。