zoukankan      html  css  js  c++  java
  • flume启动报错:java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V

    一、问题描述

      新部署的flume在启动时候报错:java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lang/String;Ljava/lang/Object;)V


    2020-06-30 11:40:20,359 (SinkRunner-PollingRunner-DefaultSinkProcessor) [ERROR - org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:459)] process failed
    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.conf.Configuration.setBoolean(Configuration.java:1679)
      at org.apache.flume.sink.hdfs.BucketWriter.open(BucketWriter.java:221)
      at org.apache.flume.sink.hdfs.BucketWriter.append(BucketWriter.java:572)
      at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:412)
      at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:67)
      at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145)
      at java.lang.Thread.run(Thread.java:748)
    Exception in thread "SinkRunner-PollingRunner-DefaultSinkProcessor" 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.conf.Configuration.setBoolean(Configuration.java:1679)
      at org.apache.flume.sink.hdfs.BucketWriter.open(BucketWriter.java:221)
      at org.apache.flume.sink.hdfs.BucketWriter.append(BucketWriter.java:572)
      at org.apache.flume.sink.hdfs.HDFSEventSink.process(HDFSEventSink.java:412)
      at org.apache.flume.sink.DefaultSinkProcessor.process(DefaultSinkProcessor.java:67)
      at org.apache.flume.SinkRunner$PollingRunner.run(SinkRunner.java:145)

    报错截图:

    {F664C7E8-5A5F-4B93-8A03-B42B20BFEFF5}_20200630115354

    问题解决:

    一般这类问题,classNotFound,不是少jar包,那就是jar包冲突,查看flume安装目录下lib下面查看是有guava这个包的:

    image

    排除少包jar包的问题,那就是jar包冲突,在查看,本地环境hadoop目录下lib中也是有这个guava这个包:

    image

    显然是二者版本不一致导致的

    问题解决:

    找到原因之后,那就有解决办法了

    将原有的flume中的低版本的guava包移除,然后拷贝hadoop/lib目录下的高版本的jar包到flume/lib中:

    image

    image

    完成上述两步操作之后,然后重新启动flume,报错消失

  • 相关阅读:
    core 3.7.1 报错 SDK.InvalidRegionId : Can not find endpoint to access.
    定时30分钟清除缓存,重置
    文件的分割与合并
    mybatis <collection property="GoodsList" column="orderId" javaType="java.util.List" ofType="ui.model.vo.GoodsList" select="selectOrderDetail" fetchType="eager"/>
    hashMap 源码注释分析(二)
    hashMap 源码注释分析(一)
    ElasticSearch 入门
    Java 三高 ,高并发 ,高可用 。高性能
    使用MyBatis返回map对象,字段值为null时不返回或返回null,目标返回自定义的默认值...
    idea html 中文乱码,控制台中文乱码,工程文件中文乱码
  • 原文地址:https://www.cnblogs.com/Gxiaobai/p/13213303.html
Copyright © 2011-2022 走看看