title: getting error whle running hive : org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException hive error and many more
body: <p>my .bashrc</p>
  
  <blockquote>
    <p>getting error while running hive:
    org.apache.hadoop.hive.ql.metadata.HiveException:
    java.lang.RuntimeException hive error and many more</p>
    
    <h1>Java</h1>
  
  <pre><code>export JAVA_HOME=/usr/lib/jvm/java-8-oracle 
  
  export PATH=$PATH:$JAVA_HOME/bin
  </code></pre>
    
    <h1>Hadoop</h1>
  
  <pre><code>export HADOOP_HOME=/usr/local/hadoop 
  export HADOOP_MAPRED_HOME=$HADOOP_HOME 
  export HADOOP_COMMON_HOME=$HADOOP_HOME 
  export HADOOP_HDFS_HOME=$HADOOP_HOME 
  export YARN_HOME=$HADOOP_HOME 
  export HADOOP_COMMON_LIB_NATIVE_DIR=$HADOOP_HOME/lib/native
  export HADOOP_OPTS="$HADOOP_OPTS -Djava.library.path=/usr/local/hadoop/lib/native"
  export HADOOP_INSTALL=$HADOOP_HOME
  export PATH=$PATH:$HADOOP_HOME/bin
  export PATH=$PATH:$HADOOP_HOME/sbin
  </code></pre>
    
    <h1>Mahout</h1>
  
  <pre><code>export MAHOUT_HOME=/usr/local/mahout
  
  # HBase
  export HBASE_HOME=/usr/local/hbase
  export PATH=$PATH:$HBASE_HOME/bin
  </code></pre>
    
    <h1>Hive</h1>
  
  <pre><code>export HIVE_HOME=/home/yash/hive/apache-hive-2.1.0-bin
  export PATH=$PATH:$HIVE_HOME/bin
  
   My hive-site.xml:
  
  &lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="configuration.xsl"?&gt;
  &lt;configuration&gt;
  &lt;property&gt;
    &lt;name&gt;javax.jdo.option.ConnectionURL&lt;/name&gt;
    &lt;value&gt;jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=true&lt;/value&gt;
  &lt;/property&gt;
  &lt;property&gt;
    &lt;name&gt;javax.jdo.option.ConnectionDriverName&lt;/name&gt;
    &lt;value&gt;com.mysql.jdbc.Driver&lt;/value&gt;
  &lt;/property&gt;
  &lt;property&gt;
    &lt;name&gt;javax.jdo.option.ConnectionUserName&lt;/name&gt;
    &lt;value&gt;root&lt;/value&gt;
  &lt;/property&gt;
  &lt;property&gt;
    &lt;name&gt;javax.jdo.option.ConnectionPassword&lt;/name&gt;
    &lt;value&gt;root&lt;/value&gt;
  &lt;/property&gt;
  &lt;property&gt;
    &lt;name&gt;datanucleus.autoCreateSchema&lt;/name&gt;
    &lt;value&gt;true&lt;/value&gt;
  &lt;/property&gt;
  &lt;property&gt;
    &lt;name&gt;datanucleus.fixedDatastore&lt;/name&gt;
    &lt;value&gt;true&lt;/value&gt;
  &lt;/property&gt;
  &lt;property&gt;
   &lt;name&gt;datanucleus.autoCreateTables&lt;/name&gt;
   &lt;value&gt;True&lt;/value&gt;
   &lt;/property&gt;
  &lt;property&gt;
      &lt;name&gt;hive.querylog.location&lt;/name&gt;
      &lt;value&gt;/home/yash/hive/apache-hive-2.1.0-bin/iotmp&lt;/value&gt;
      &lt;description&gt;Location of Hive run time structured log file&lt;/description&gt;
    &lt;/property&gt;
    &lt;property&gt;
      &lt;name&gt;hive.exec.local.scratchdir&lt;/name&gt;
      &lt;value&gt;/home/yash/hive/apache-hive-2.1.0-bin/iotmp&lt;/value&gt;
      &lt;description&gt;Local scratch space for Hive jobs&lt;/description&gt;
    &lt;/property&gt;
    &lt;property&gt;
      &lt;name&gt;hive.downloaded.resources.dir&lt;/name&gt;
      &lt;value&gt;/home/yash/hive/apache-hive-2.1.0-bin/iotmp&lt;/value&gt;
      &lt;description&gt;Temporary local directory for added resources in the        remote file system.&lt;/description&gt;
    &lt;/property&gt;
  &lt;/configuration&gt;
   &lt;i&gt;ERROR&lt;i&gt;
  
      SLF4J: Class path contains multiple SLF4J bindings.
      SLF4J: Found binding in [jar:file:/home/yash/hive/apache-hive-2.1.0-bin/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
      SLF4J: Found binding in [jar:file:/usr/local/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]
  
      Logging initialized using configuration in jar:file:/home/yash/hive/apache-hive-2.1.0-bin/lib/hive-common-2.1.0.jar!/hive-log4j2.properties
  </code></pre>
    
    <p>Async: true
            Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata.HiveException:
    java.lang.RuntimeException: Unable to instantiate
    org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
              at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:578)
              at org.apache.hadoop.hive.ql.session.SessionState.beginStart(SessionState.java:518)
              at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:705)
              at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:641)
              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:239)
              at org.apache.hadoop.util.RunJar.main(RunJar.java:153)
            Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.lang.RuntimeException: Unable to instantiate
    org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
              at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:226)
              at org.apache.hadoop.hive.ql.metadata.Hive.(Hive.java:366)
              at org.apache.hadoop.hive.ql.metadata.Hive.create(Hive.java:310)
              at org.apache.hadoop.hive.ql.metadata.Hive.getInternal(Hive.java:290)
              at org.apache.hadoop.hive.ql.metadata.Hive.get(Hive.java:266)
              at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:545)
              ... 9 more
            Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
              at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1627)
              at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.(RetryingMetaStoreClient.java:80)
              at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:130)
              at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:101)
              at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:3317)
              at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3356)
              at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:3336)
              at org.apache.hadoop.hive.ql.metadata.Hive.getAllFunctions(Hive.java:3590)
              at org.apache.hadoop.hive.ql.metadata.Hive.reloadFunctions(Hive.java:236)
              at org.apache.hadoop.hive.ql.metadata.Hive.registerAllFunctionsOnce(Hive.java:221)
              ... 14 more
            Caused by: java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
              at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
              at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1625)
              ... 23 more
            Caused by: java.lang.IllegalArgumentException: Unrecognized Hadoop major version number: 3.0.1
              at org.apache.hadoop.hive.shims.ShimLoader.getMajorVersion(ShimLoader.java:169)
              at org.apache.hadoop.hive.shims.ShimLoader.loadShims(ShimLoader.java:136)
              at org.apache.hadoop.hive.shims.ShimLoader.getHadoopShims(ShimLoader.java:95)
              at org.apache.hadoop.hive.metastore.ObjectStore.getDataSourceProps(ObjectStore.java:402)
              at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:275)
              at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:77)
              at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:137)
              at org.apache.hadoop.hive.metastore.RawStoreProxy.(RawStoreProxy.java:58)
              at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:67)
              at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:581)
              at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:546)
              at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:608)
              at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:398)
              at org.apache.hadoop.hive.metastore.RetryingHMSHandler.(RetryingHMSHandler.java:78)
              at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:84)
              at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:6396)
              at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.(HiveMetaStoreClient.java:236)
              at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.(SessionHiveMetaStoreClient.java:70)
              ... 28 more</p>
  </blockquote>