Exception in thread "main" java.lang.RuntimeException:java.lang.RuntimeException:Unable to instantiate Org.apache.hadoop.hive.metastore.HiveMetaStoreClient
At Org.apache.hadoop.hive.ql.session.SessionState.start (sessionstate.java:344)
At Org.apache.hadoop.hive.cli.CliDriver.run (clidriver.java:681)
At Org.apache.hadoop.hive.cli.CliDriver.main (clidriver.java:625)
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.run (runjar.java:221)
At Org.apache.hadoop.util.RunJar.main (runjar.java:136)
caused By:java.lang.RuntimeException:Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient
At Org.apache.hadoop.hive.metastore.MetaStoreUtils.newInstance (metastoreutils.java:1412)
At Org.apache.hadoop.hive.metastore.retryingmetastoreclient.<init> (retryingmetastoreclient.java:62)
At Org.apache.hadoop.hive.metastore.RetryingMetaStoreClient.getProxy (retryingmetastoreclient.java:72)
At Org.apache.hadoop.hive.ql.metadata.Hive.createMetaStoreClient (hive.java:2444)
At Org.apache.hadoop.hive.ql.metadata.Hive.getMSC (hive.java:2456)
At Org.apache.hadoop.hive.ql.session.SessionState.start (sessionstate.java:338)
... 8 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:1410)
... More
caused By:javax.jdo.JDOFatalDataStoreException:Unable to open a test connection to the given database. JDBC url = jdbc:mysql://192.168.113.217:3306/hive?createdatabaseifnotexist=true, username = test_user. Terminating connection pool (set Lazyinit to True if your expect to start your the database after your app). Original Exception:------
Java.sql.SQLException:Access denied for user ' test_user ' @ ' HRM ' (using Password:yes)
At Com.mysql.jdbc.SQLError.createSQLException (sqlerror.java:1073)
At Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3609)
At Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:3541)
At Com.mysql.jdbc.MysqlIO.checkErrorPacket (mysqlio.java:943)
At com.mysql.jdbc.MysqlIO.secureAuth411 (mysqlio.java:4113)
At Com.mysql.jdbc.MysqlIO.doHandshake (mysqlio.java:1308)
At Com.mysql.jdbc.ConnectionImpl.coreConnect (connectionimpl.java:2336)
At Com.mysql.jdbc.ConnectionImpl.connectOneTryOnly (connectionimpl.java:2369)
At Com.mysql.jdbc.ConnectionImpl.createNewIO (connectionimpl.java:2153)
At Com.mysql.jdbc.connectionimpl.<init> (connectionimpl.java:792)
At Com.mysql.jdbc.jdbc4connection.<init> (jdbc4connection.java:47)
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 Com.mysql.jdbc.Util.handleNewInstance (util.java:411)
At Com.mysql.jdbc.ConnectionImpl.getInstance (connectionimpl.java:381)
At Com.mysql.jdbc.NonRegisteringDriver.connect (nonregisteringdriver.java:305)
At Java.sql.DriverManager.getConnection (drivermanager.java:571)
At Java.sql.DriverManager.getConnection (drivermanager.java:187)
At Com.jolbox.bonecp.BoneCP.obtainRawInternalConnection (bonecp.java:361)
At Com.jolbox.bonecp.bonecp.<init> (bonecp.java:416)
At Com.jolbox.bonecp.BoneCPDataSource.getConnection (bonecpdatasource.java:120)
At Org.datanucleus.store.rdbms.connectionfactoryimpl$managedconnectionimpl.getconnection ( connectionfactoryimpl.java:501)
Workaround:
The hive-site.xml inside the database connection address to localhost:3306 mode, you can solve
Hive error java.lang.RuntimeException:Unable to instantiate org.apache.hadoop.hive.metastore.HiveMetaStoreClient