[ 
https://issues.apache.org/jira/browse/HIVE-22915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17283290#comment-17283290
 ] 

James Baiera commented on HIVE-22915:
-------------------------------------

I encountered this problem because the guava libraries are embedded into the 
hive-exec jar. If you have hive libraries on your classpath and attempt to 
interact with anything using a newer version of Guava this will break it. You 
can try and force a newer version of guava to be in front of the hive jar on 
the classpath, but this is not a reasonable work around. The other 
recommendations I've seen are to compile the hive jars yourself. That 
workaround is arguably worse.

These packages that have been included into hive should be relocated during the 
build process. It's one thing if it's hadoop libraries where maybe it's 
reasonable for them to override those included in the hive jar. Guava is very 
different. Guava is such a contentious library for a number of reasons: lots of 
versions, lots of breaking changes, lots of new features that can't run on 
older versions. If you're using guava and it's packaged into an artifact you 
release, then it should really be moved to a different package in the final 
artifact.

> java.lang.NoSuchMethodError: 
> com.google.common.base.Preconditions.checkArgument
> -------------------------------------------------------------------------------
>
>                 Key: HIVE-22915
>                 URL: https://issues.apache.org/jira/browse/HIVE-22915
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>    Affects Versions: 2.3.4
>         Environment: Ubuntu 16.04
>            Reporter: pradeepkumar
>            Priority: Critical
>
> Hi Team,
> I am Not able to run hive. Getting following error on hive version above 3.X, 
> i tried all the versions. It is very critical issue.SLF4J: Class path 
> contains multiple SLF4J bindings.
>  SLF4J: Found binding in 
> [jar:file:/home/sreeramadasu/Downloads/hive/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>  SLF4J: Found binding in 
> [jar:file:/home/sreeramadasu/Downloads/hadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
>  SLF4J: See [http://www.slf4j.org/codes.html#multiple_bindings] for an 
> explanation.
>  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:4045)
>  at org.apache.hadoop.hive.conf.HiveConf.<init>(HiveConf.java:4003)
>  at 
> org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:81)
>  at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:65)
>  at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:702)
>  at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:686)
>  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)
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to