ICode9

精准搜索请尝试: 精确搜索
首页 > 编程语言> 文章详细

flume启动报错:java.lang.NoSuchMethodError: com.google.common.base.Preconditions.checkArgument(ZLjava/lan

2020-06-30 13:57:43  阅读:10  来源: 互联网

标签:lang flume java 报错 apache org Configuration


一、问题描述

  新部署的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,报错消失

标签:lang,flume,java,报错,apache,org,Configuration
来源: https://www.cnblogs.com/Gxiaobai/p/13213303.html

专注分享技术,共同学习,共同进步。侵权联系[admin#icode9.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有