错误一:
Exception in thread "main" java.lang.NoClassDefFoundError: jline/console/completer/ArgumentCompleter$ArgumentDelimiter at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.apache.hadoop.util.RunJar.run(RunJar.java:214) at org.apache.hadoop.util.RunJar.main(RunJar.java:136) Caused by: java.lang.ClassNotFoundException: jline.console.completer.ArgumentCompleter$ArgumentDelimiter at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 4 more
此问题是hadoop与hive中的Jline包版本不一致导致的,解决办法就是将hive/lib下的Jline-2.12.jar复制到hadoop/share/hadoop/yarn/lib/下即可
错误2:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/CommandNeedRetryException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:274) at org.apache.hadoop.util.RunJar.main(RunJar.java:153) Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.CommandNeedRetryException at java.net.URLClassLoader$1.run(URLClassLoader.java:366) at java.net.URLClassLoader$1.run(URLClassLoader.java:355) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:354) at java.lang.ClassLoader.loadClass(ClassLoader.java:425) at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ... 3 more
或者:
- Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/conf/HiveConf
- at java.lang.Class.forName0(Native Method)
- at java.lang.Class.forName(Class.java:274)
- at org.apache.hadoop.util.RunJar.main(RunJar.java:205)
- Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.conf.HiveConf
- at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
- at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
- at java.security.AccessController.doPrivileged(Native Method)
- at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
- at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
- at java.lang.Cl
这个错误搜了半天就是说在hadoop-evn.sh的配置文件中,路径设置存在问题,解决方案就是修改配置文件,
export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/usr/local/hbase/lib/*:/usr/lib/hbase/* export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HBASE_HOME/hbase-1.1.15.jar: export HBASE_HOME=/home/hadoop/hbase-1.1.15 export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:$HBASE_HOME/hbase-1.1.15.jar:$HBASE_HOME/hbase-it-1.1.15-tests.jar:$HBASE_HOME/conf:$HBASE_HOME/lib/zookeeper-3.4.6.jar
在配置文件中查看,对于HADOOP_CLASSPATH的配置来说前面需要加上红色部分($HADOOP_CLASSPATH:)否则就会导致后来的配置将上面的配置覆盖,导致上面的错误。