Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.addDeprecation

Tags:

hadoop

I plan to install hive0.12 with hadoop-1.2.1. After hadoop-1.2.1 installed,I also have configured hive0.12. But when I use bin/hive command I get:

Exception in thread "main" java.lang.NoSuchMethodError: org.apache.hadoop.conf.Configuration.addDeprecation(Ljava/lang/String;Ljava/lang/String;)V
    at org.apache.hadoop.hive.conf.HiveConf.<clinit>(HiveConf.java:77)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4jCommon(LogUtils.java:74)
    at org.apache.hadoop.hive.common.LogUtils.initHiveLog4j(LogUtils.java:58)
    at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:639)
    at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:623)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:160)

how to solve the problem?

like image 562
user3212050 Avatar asked Jan 11 '23 06:01

user3212050


1 Answers

Reason

org.apache.hadoop.conf.Configuration.addDeprecation() method is added from hadoop 2.3.0. But as you wrote, your hadoop distribution is 1.2.1. In short, your hive installation and hadoop installation are not fit each other. Your hive installation must be rebuilded for hadoop 1.2.1.

Solution

First choice: upgrade your hadoop installation to 2.x.x

This approach is the easist one. As hadoop 1.2.1 will not be updated anymore, upgrading your installation is feasible. Remove your current hadoop installation and install hadoop 2.5.1(the latest version, as of now.). For installing it, his tutorial is recommended.

Second choice: rebuild your hive distribution for hadoop 1.2.1

You must builded your hive distribution with following command, when you installed it:

mvn clean install -Phadoop-2,dist

Try this command:

mvn clean install -Phadoop-1,dist

With this command, the output will be created in packaging/target/apache-hive-0.12-bin directory. Replace your current hive installtion with it.

like image 148
Lee Dongjin Avatar answered Feb 26 '23 15:02

Lee Dongjin