**
Error configuring application listener of class org.springframework.web.util.Log4jConfigListener
**
Eclipse使用Maven创建项目之后,部署到tomcat,控制台输出如下:
信息: Starting service [Catalina]
十月 23, 2019 9:50:45 上午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.5.28
十月 23, 2019 9:50:49 上午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
十月 23, 2019 9:50:53 上午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
十月 23, 2019 9:50:53 上午 org.apache.catalina.core.StandardContext listenerStart
严重: 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:1291)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:544)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:525)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4675)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5215)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
十月 23, 2019 9:50:53 上午 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
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1291)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1119)
at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:544)
at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:525)
at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:150)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4675)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5215)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1409)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
十月 23, 2019 9:50:53 上午 org.apache.catalina.core.StandardContext listenerStart
严重: Skipped installing application listeners due to previous error(s)
十月 23, 2019 9:50:53 上午 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
十月 23, 2019 9:50:53 上午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/clothing-nico-manage] startup failed due to previous errors
十月 23, 2019 9:50:53 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8081"]
十月 23, 2019 9:50:53 上午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8019"]
十月 23, 2019 9:50:53 上午 org.apache.catalina.startup.Catalina start
信息: Server startup in 7959 ms
网上大部分多是讲jar文件没有同步发布到自己项目的lib目录中
解决的办法:
解决方法:
1、项目右键->【Properties】->【Deployment Assembly】->【Add】
2、把maven的依赖添加进去
这能够解决的是Maven管理的jar包没导入项目的清空。
还有一种情况是已导入Maven管理的jar包,依然报错。
这其实是pom.xml文件需要引入这个jar包
<!-- Spring web -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>${spring.version}</version>
</dependency>
Spring版本使用父工程管理,我使用的版本是4.3.10.RELEASE,解决了Error configuring application listener of class org.springframework.web.util.Log4jConfigListener报错。
在导入spring-web.jar包之后又产生另一个问题。在下一篇中记录解决方式。