Hive客户端启动报SLF4J: Class path contains multiple SLF4J bindings.
时间: 2023-11-09 13:56:50 浏览: 531
SLF4J是一个日志门面系统,用于在Java应用程序中实现日志记录。报错"SLF4J: Class path contains multiple SLF4J bindings"表示在Hive客户端启动时发现了多个SLF4J绑定。这通常是由于在类路径中同时包含了多个SLF4J实现库引起的。
解决此问题的方法是删除其中一个SLF4J实现库。根据提供的引用,你可以尝试删除`log4j-slf4j-impl-2.10.0.jar`文件。可以使用以下命令执行删除操作:
```
sudo rm ./log4j-slf4j-impl-2.10.0.jar
```
完成后,重新启动Hive客户端应该不再报告这个错误。
相关问题
启动flume是报以下错误Info: Including Hadoop libraries found via (/opt/software/hadoop-2.8.3/bin/hadoop) for HDFS access Info: Including Hive libraries found via (/opt/software/hive-2.3.3) for Hive access + exec /opt/jdk1.8.0_261/bin/java -Xmx20m -cp '/opt/software/flume-1.8.0/conf:/opt/software/flume-1.8.0/lib/*:/opt/software/hadoop-2.8.3/etc/hadoop:/opt/software/hadoop-2.8.3/share/hadoop/common/lib/*:/opt/software/hadoop-2.8.3/share/hadoop/common/*:/opt/software/hadoop-2.8.3/share/hadoop/hdfs:/opt/software/hadoop-2.8.3/share/hadoop/hdfs/lib/*:/opt/software/hadoop-2.8.3/share/hadoop/hdfs/*:/opt/software/hadoop-2.8.3/share/hadoop/yarn/lib/*:/opt/software/hadoop-2.8.3/share/hadoop/yarn/*:/opt/software/hadoop-2.8.3/share/hadoop/mapreduce/lib/*:/opt/software/hadoop-2.8.3/share/hadoop/mapreduce/*:/contrib/capacity-scheduler/*.jar:/opt/software/hive-2.3.3/lib/*' -Djava.library.path=:/opt/software/hadoop-2.8.3/lib/native org.apache.flume.node.Application --conf-file /opt/software/flume-1.8.0/conf/hdfs.conf --name agent1 Dflume.root.logger=DEBUG,console SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/software/flume-1.8.0/lib/slf4j-log4j12-1.6.1.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/software/hadoop-2.8.3/share/hadoop/common/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/software/hive-2.3.3/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.是什么原因
这个错误是由于在classpath中包含了多个SLF4J的绑定引起的。由于SLF4J提供了多种绑定,如果在classpath中包含了多个绑定,就会导致这个异常。为了解决这个问题,你可以在classpath中保留一个绑定,并删除其他绑定。或者你可以通过在classpath中包含一个名为slf4j-over-log4j的JAR来解决这个问题,它可以将所有SLF4J日志记录器路由到Log4J日志记录器。
Class path contains multiple SLF4J bindings hive
Hi, it seems like you are facing an issue with multiple SLF4J bindings in your classpath. This error occurs when there are multiple versions of the SLF4J library present in your project dependencies.
To resolve this issue, you need to identify the conflicting dependencies and exclude one of them. Here's how you can do it:
1. Identify the dependencies causing the conflict by checking your project's dependency tree or analyzing the logs.
2. Once you have identified the conflicting dependencies, you can exclude one of them from your project's build configuration. For example, if you are using Maven, you can exclude a dependency like this:
```xml
<dependency>
<groupId>example.groupId</groupId>
<artifactId>example.artifactId</artifactId>
<version>example.version</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
```
3. Make sure to rebuild and test your project to ensure that it is working as expected.
By excluding one of the conflicting SLF4J bindings, you should be able to resolve this issue.
阅读全文