I was trying to build spark environment on CentOS6.8 on macOS using VMware Fusion.
I have previously installed jdk-10.0.1, hadoop-2.4.1.tar.gz, and MySQL. They worked successfully.
However, when I was trying to format matadata repository,
schematool -dbType mysql -initSchema
the following error happened:
which: no hbase in (/opt/hive/bin:/usr/local/hive/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/latest/bin:/usr/local/hadoop/sbin:/usr/local/hadoop/bin:/usr/local/hive/bin:/root/bin:/usr/java/latest/bin:/usr/local/hadoop/sbin:/usr/local/hadoop/bin:/opt/hive/bin)
^HMetastore connection URL: jdbc:mysql://hbase01:3306/myhive?createDatabaseIfNotExist=true
Metastore Connection Driver : com.mysql.jdbc.Driver
Metastore connection User: myhive
org.apache.hadoop.hive.metastore.HiveMetaException: Failed to load driver
Underlying cause: java.lang.ClassNotFoundException : com.mysql.jdbc.Driver
Use --verbose for detailed stacktrace.
*** schemaTool failed ***
I ignored it and entered "$HIVE_HOME/bin/hive", the following error happened:
which: no hbase in (/opt/hive/bin:/usr/local/hive/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/java/latest/bin:/usr/local/hadoop/sbin:/usr/local/hadoop/bin:/usr/local/hive/bin:/root/bin:/usr/java/latest/bin:/usr/local/hadoop/sbin:/usr/local/hadoop/bin:/opt/hive/bin)
Exception in thread "main" java.lang.ClassCastException: java.base/jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to java.base/java.net.URLClassLoader
at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:387)
at org.apache.hadoop.hive.ql.session.SessionState.<init>(SessionState.java:363)
at org.apache.hadoop.hive.cli.CliSessionState.<init>(CliSessionState.java:60)
at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:663)
at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:641)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.apache.hadoop.util.RunJar.main(RunJar.java:212)
I am sure that I have put the mysql-connector-java into the lib folder of hive. But still there is something wrong.
Any help is appreciated. Thanks a lot!