title: Not able to start hive shell -- Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
body: <p>I have installed hive 0.14 a few months back. It was running fine. But when i start now it throws me below error. I have only installed spark,mysql,hbase in my ubuntu machine after hive installation, however hbase is also not starting.  Thought java could be an issue as i had two jdk versions installed, unistalled the whole java package and installed oracle java 7 and pointed my JAVA_HOME to /usr/lib/jvm/java-7-oracle.That did not resolve my issue so installed a new hive version 1.0.1,that also didn't favor me.I googled a lot for the same error and tried applying it but no luck. I am not sure whether any recent installtion of spark is causing me a mismatch. Could someone help me in resolving this. Below is the error.</p>
  
  <pre><code>Logging initialized using configuration in jar:file:/home/hduser/hadoop/hive/lib/hive-common-1.0.1.jar!/hive-log4j.properties
  Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient
      at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:444)
      at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:626)
      at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:570)
      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)
  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:1453)
      at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.&lt;init&gt;(RetryingMetaStoreClient.java:63)
      at org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy(RetryingMetaStoreClient.java:73)
      at org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient(Hive.java:2664)
      at org.apache.hadoop.hive.ql.metadata.Hive.getMSC(Hive.java:2683)
      at org.apache.hadoop.hive.ql.session.SessionState.start(SessionState.java:425)
      ... 7 more
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance(MetaStoreUtils.java:1451)
      ... 12 more
  Caused by: javax.jdo.JDOFatalInternalException: Error creating transactional connection factory
  NestedThrowables:
  java.lang.reflect.InvocationTargetException
      at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:587)
      at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:788)
      at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.createPersistenceManagerFactory(JDOPersistenceManagerFactory.java:333)
      at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:202)
      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 javax.jdo.JDOHelper$16.run(JDOHelper.java:1965)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.jdo.JDOHelper.invoke(JDOHelper.java:1960)
      at javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:1166)
      at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:808)
      at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:701)
      at org.apache.hadoop.hive.metastore.ObjectStore.getPMF(ObjectStore.java:340)
      at org.apache.hadoop.hive.metastore.ObjectStore.getPersistenceManager(ObjectStore.java:369)
      at org.apache.hadoop.hive.metastore.ObjectStore.initialize(ObjectStore.java:266)
      at org.apache.hadoop.hive.metastore.ObjectStore.setConf(ObjectStore.java:233)
      at org.apache.hadoop.util.ReflectionUtils.setConf(ReflectionUtils.java:62)
      at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:117)
      at org.apache.hadoop.hive.metastore.RawStoreProxy.&lt;init&gt;(RawStoreProxy.java:56)
      at org.apache.hadoop.hive.metastore.RawStoreProxy.getProxy(RawStoreProxy.java:65)
      at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.newRawStore(HiveMetaStore.java:560)
      at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.getMS(HiveMetaStore.java:538)
      at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.createDefaultDB(HiveMetaStore.java:591)
      at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.init(HiveMetaStore.java:429)
      at org.apache.hadoop.hive.metastore.RetryingHMSHandler.&lt;init&gt;(RetryingHMSHandler.java:66)
      at org.apache.hadoop.hive.metastore.RetryingHMSHandler.getProxy(RetryingHMSHandler.java:72)
      at org.apache.hadoop.hive.metastore.HiveMetaStore.newRetryingHMSHandler(HiveMetaStore.java:5502)
      at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.&lt;init&gt;(HiveMetaStoreClient.java:184)
      at org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient.&lt;init&gt;(SessionHiveMetaStoreClient.java:73)
      ... 17 more
  Caused by: java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:631)
      at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:325)
      at org.datanucleus.store.AbstractStoreManager.registerConnectionFactory(AbstractStoreManager.java:282)
      at org.datanucleus.store.AbstractStoreManager.&lt;init&gt;(AbstractStoreManager.java:240)
      at org.datanucleus.store.rdbms.RDBMSStoreManager.&lt;init&gt;(RDBMSStoreManager.java:286)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
      at org.datanucleus.plugin.NonManagedPluginRegistry.createExecutableExtension(NonManagedPluginRegistry.java:631)
      at org.datanucleus.plugin.PluginManager.createExecutableExtension(PluginManager.java:301)
      at org.datanucleus.NucleusContext.createStoreManagerForProperties(NucleusContext.java:1187)
      at org.datanucleus.NucleusContext.initialise(NucleusContext.java:356)
      at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.freezeConfiguration(JDOPersistenceManagerFactory.java:775)
      ... 46 more
  Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.jolbox.bonecp.BoneCPConfig
      at org.datanucleus.store.rdbms.connectionpool.BoneCPConnectionPoolFactory.createConnectionPool(BoneCPConnectionPoolFactory.java:59)
      at org.datanucleus.store.rdbms.ConnectionFactoryImpl.generateDataSources(ConnectionFactoryImpl.java:238)
      at org.datanucleus.store.rdbms.ConnectionFactoryImpl.initialiseDataSources(ConnectionFactoryImpl.java:131)
      at org.datanucleus.store.rdbms.ConnectionFactoryImpl.&lt;init&gt;(ConnectionFactoryImpl.java:85)
      ... 64 more
  </code></pre>
  
  <p>I have set JAVA_HOME and HADOOP_HOME in bashrc and both are resolving properly when i echoed the path inside hive script and i am using the default derby DB. So hive-env.sh and hive-site.xml is not set explicitly.</p>