提示Found binding in: slf4j-log4j12、logback-classic两个jar包,下面又写Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path,那是slf4j-log4j12、logback-classic冲突还是log4j-over-slf4j、slf4j-log4j12冲突,应该怎么理解的呢?
报错内容如下:
2021-10-17 15:02:07 17-Oct-2021 15:02:07.933 INFO [localhost-startStop-1] 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.
2021-10-17 15:02:08 SLF4J: Class path contains multiple SLF4J bindings.
2021-10-17 15:02:08 SLF4J: Found binding in [jar:file:/usr/local/tomcat/webapps/chnl-base-service/WEB-INF/lib/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
2021-10-17 15:02:08 SLF4J: Found binding in [jar:file:/usr/local/tomcat/webapps/chnl-base-service/WEB-INF/lib/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
2021-10-17 15:02:08 SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
2021-10-17 15:02:08 SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError.
2021-10-17 15:02:08 SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
2021-10-17 15:02:08 17-Oct-2021 15:02:08.103 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
2021-10-17 15:02:08 org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/chnl-base-service]]
2021-10-17 15:02:08 at org.apache.catalina.util.LifecycleBase.handleSubClassException(LifecycleBase.java:440)
2021-10-17 15:02:08 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:198)
2021-10-17 15:02:08 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:743)
2021-10-17 15:02:08 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
2021-10-17 15:02:08 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
2021-10-17 15:02:08 at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
2021-10-17 15:02:08 at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1840)
2021-10-17 15:02:08 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2021-10-17 15:02:08 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-10-17 15:02:08 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2021-10-17 15:02:08 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2021-10-17 15:02:08 at java.lang.Thread.run(Thread.java:748)
2021-10-17 15:02:08 Caused by: java.lang.ExceptionInInitializerError
2021-10-17 15:02:08 at org.slf4j.impl.StaticLoggerBinder.<init>(StaticLoggerBinder.java:72)
2021-10-17 15:02:08 at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:45)
2021-10-17 15:02:08 at org.slf4j.LoggerFactory.bind(LoggerFactory.java:129)
2021-10-17 15:02:08 at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:108)
2021-10-17 15:02:08 at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:302)
2021-10-17 15:02:08 at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:276)
2021-10-17 15:02:08 at org.apache.commons.logging.LogAdapter$Slf4jAdapter.createLocationAwareLog(LogAdapter.java:130)
2021-10-17 15:02:08 at org.apache.commons.logging.LogAdapter.createLog(LogAdapter.java:91)
2021-10-17 15:02:08 at org.apache.commons.logging.LogFactoryService.getInstance(LogFactoryService.java:46)
2021-10-17 15:02:08 at org.apache.commons.logging.LogFactoryService.getInstance(LogFactoryService.java:41)
2021-10-17 15:02:08 at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
2021-10-17 15:02:08 at org.springframework.boot.web.servlet.support.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:90)
2021-10-17 15:02:08 at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:172)
2021-10-17 15:02:08 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5152)
2021-10-17 15:02:08 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
2021-10-17 15:02:08 ... 10 more
2021-10-17 15:02:08 Caused by: java.lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
2021-10-17 15:02:08 at org.slf4j.impl.Log4jLoggerFactory.<clinit>(Log4jLoggerFactory.java:54)
2021-10-17 15:02:08 ... 25 more
2021-10-17 15:02:08 17-Oct-2021 15:02:08.104 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive [/usr/local/tomcat/webapps/chnl-base-service.war]
2021-10-17 15:02:08 java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/chnl-base-service]]
2021-10-17 15:02:08 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:747)
2021-10-17 15:02:08 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:719)
2021-10-17 15:02:08 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:705)
2021-10-17 15:02:08 at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:970)
2021-10-17 15:02:08 at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1840)
2021-10-17 15:02:08 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2021-10-17 15:02:08 at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2021-10-17 15:02:08 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2021-10-17 15:02:08 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2021-10-17 15:02:08 at java.lang.Thread.run(Thread.java:748)
2021-10-17 15:02:08 17-Oct-2021 15:02:08.105 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployWAR Deployment of web application archive [/usr/local/tomcat/webapps/chnl-base-service.war] has finished in [11,325] ms
2021-10-17 15:02:08 17-Oct-2021 15:02:08.109 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
2021-10-17 15:02:08 17-Oct-2021 15:02:08.119 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 11406 ms