Eclipse工程启动错误:ClassNotFoundException-Log4jConfigListener

Eclipse工程启动错误:ClassNotFoundException-Log4jConfigListener
Git更新代码后运行报如下错误

严重: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener
java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
    at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:495)
    at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:477)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:5034)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5634)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1571)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1561)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)
造成问题的原因是多样的,其中可能原因就是maven依赖没导入。从工程结构看,貌似是导入了,如下图,实际部署配置中并未引入。

Eclipse工程启动错误:ClassNotFoundException-Log4jConfigListener_第1张图片

这种情况需要在DeploymentAssemebly中手动添加。
Eclipse工程启动错误:ClassNotFoundException-Log4jConfigListener_第2张图片
Eclipse工程启动错误:ClassNotFoundException-Log4jConfigListener_第3张图片
添加后,点击确定,重新运行即可。

你可能感兴趣的:(踩过的坑)