我正在IDEA中使用maven构建一个Java Web项目。该项目使用SSM框架。我已经在pom.xml中添加了slf4j-api 1.7.21和slf4j-simple 1.7.21
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version> <!-- or use LATEST -->
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.21</version> <!-- or use LATEST -->
</dependency>
但是它仍然有错误
“ SLF4J:无法加载类“ org.slf4j.impl.StaticLoggerBinder”。 SLF4J:默认为无操作(NOP)记录器实现 SLF4J:有关更多详细信息,请参见http://www.slf4j.org/codes.html#StaticLoggerBinder。”
所有日志如下
C:\tomcat7\bin\catalina.bat run
[2019-10-12 10:00:44,241] Artifact test4:war exploded: Waiting for server connection to start artifact deployment...
Using CATALINA_BASE: "C:\tomcat7"
Using CATALINA_HOME: "C:\tomcat7"
Using CATALINA_TMPDIR: "C:\tomcat7\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.8.0_192"
Using CLASSPATH: "C:\tomcat7\bin\bootstrap.jar;C:\tomcat7\bin\tomcat-juli.jar"
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/7.0.64
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Aug 19 2015 17:18:06 UTC
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 7.0.64.0
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 10
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 10.0
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: amd64
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jdk1.8.0_192\jre
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_192-b12
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: C:\tomcat7
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: C:\tomcat7
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcom.sun.management.jmxremote=
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcom.sun.management.jmxremote.port=1099
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcom.sun.management.jmxremote.ssl=false
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcom.sun.management.jmxremote.password.file=C:\Users\ustc-nanmu\.IntelliJIdea2019.2\system\tomcat\Unnamed_test4_2\jmxremote.password
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcom.sun.management.jmxremote.access.file=C:\Users\ustc-nanmu\.IntelliJIdea2019.2\system\tomcat\Unnamed_test4_2\jmxremote.access
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.rmi.server.hostname=127.0.0.1
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.util.logging.config.file=C:\tomcat7\conf\logging.properties
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=C:\tomcat7\endorsed
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=C:\tomcat7
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=C:\tomcat7
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.io.tmpdir=C:\tomcat7\temp
十月 12, 2019 10:00:45 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.8.0_192\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\NetSarang\Xshell 6\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\MATLAB\R2018a\runtime\win64;C:\Program Files\MATLAB\R2018a\bin;C:\Android;C:\Windows\System32;C:\Program Files\Pandoc\;C:\maven\apache-maven-3.6.2\bin;C:\Program Files\Java\jdk1.8.0_192\bin;C:\Program Files\Redis\;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\ustc-nanmu\AppData\Local\BypassRuntm;.
十月 12, 2019 10:00:45 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-bio-8080"]
十月 12, 2019 10:00:45 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-bio-8089"]
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 341 ms
十月 12, 2019 10:00:45 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
十月 12, 2019 10:00:45 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/7.0.64
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory C:\tomcat7\webapps\ROOT
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory C:\tomcat7\webapps\ROOT has finished in 261 ms
十月 12, 2019 10:00:45 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory C:\tomcat7\webapps\test4_war
十月 12, 2019 10:00:46 下午 org.apache.catalina.startup.TldConfig execute
信息: 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.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
十月 12, 2019 10:00:47 下午 com.mchange.v2.log.MLog <clinit>
信息: MLog clients using java 1.4+ standard logging.
十月 12, 2019 10:00:47 下午 com.mchange.v2.c3p0.C3P0Registry banner
信息: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
十月 12, 2019 10:00:47 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
十月 12, 2019 10:00:47 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/test4_war] startup failed due to previous errors
十月 12, 2019 10:00:48 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory C:\tomcat7\webapps\test4_war has finished in 2,606 ms
十月 12, 2019 10:00:48 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-bio-8080"]
十月 12, 2019 10:00:48 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-bio-8089"]
十月 12, 2019 10:00:48 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 2901 ms
Connected to server
[2019-10-12 10:00:48,332] Artifact test4:war exploded: Artifact is being deployed, please wait...
十月 12, 2019 10:00:49 下午 org.apache.catalina.startup.TldConfig execute
信息: 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.
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
十月 12, 2019 10:00:50 下午 com.mchange.v2.log.MLog <clinit>
信息: MLog clients using java 1.4+ standard logging.
十月 12, 2019 10:00:50 下午 com.mchange.v2.c3p0.C3P0Registry banner
信息: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace: 10]
十月 12, 2019 10:00:50 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
十月 12, 2019 10:00:50 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/test4_war_exploded] startup failed due to previous errors
[2019-10-12 10:00:50,316] Artifact test4:war exploded: Error during artifact deployment. See server log for details.
谢谢您解决这个问题