• hive环境搭建提示: java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument


    提示的错误信息:

    SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
    Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V
            at org.apache.hadoop.conf.Configuration.set(Configuration.java:1357)
            at org.apache.hadoop.conf.Configuration.set(Configuration.java:1338)
            at org.apache.hadoop.mapred.JobConf.setJar(JobConf.java:536)
            at org.apache.hadoop.mapred.JobConf.setJarByClass(JobConf.java:554)
            at org.apache.hadoop.mapred.JobConf.<init>(JobConf.java:448)
            at org.apache.hadoop.hive.conf.HiveConf.initialize(HiveConf.java:5141)
            at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:5099)
            at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:97)
            at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:81)
            at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:699)
            at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:683)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:498)
            at org.apache.hadoop.util.RunJar.run(RunJar.java:323)
            at org.apache.hadoop.util.RunJar.main(RunJar.java:236)

    关键在: com.google.common.base.Preconditions.checkArgument 这是因为hive内依赖的guava.jar和hadoop内的版本不一致造成的。 检验方法:

    1. 查看hadoop安装目录下share/hadoop/common/lib内guava.jar版本
    2. 查看hive安装目录下lib内guava.jar的版本 如果两者不一致,删除版本低的,并拷贝高版本的 问题解决!

    但是我后来发现这样会带来其他问题

    其他版本的guava可以从mvn仓库下载

    参考链接:https://blog.csdn.net/GQB1226/article/details/102555820

  • 相关阅读:
    [luogu8331]简单题
    [luogu8340]山河重整
    [luogu8291]学术社区
    [atARC140E]Not Equal Rectangle
    [luogu8332]面条
    PKUSC2022 总结
    tried accessing the SQLite plugin but Cordova is not available
    Angular安装旧项目的依赖包,运行项目出现异常NullInjectorError: No provider for NzModalService!(环境已升级)
    Angular + ABP前后端分离 登录验证码
    c# RSA加密
  • 原文地址:https://www.cnblogs.com/lfri/p/13096283.html
Copyright © 2020-2023  润新知