hive安装失败,提示找不到类 org/apache/thrift/TException

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hive安装失败,提示找不到类 org/apache/thrift/TException相关的知识,希望对你有一定的参考价值。

使用ubuntu14.04安装hadoop后安装hive,在/etc/profile中配置的环境变量如下:export JAVA_HOME=/home/hongchq/tools/jdk1.6.0_16export JRE_HOME=$JAVA_HOME/jreexport CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATHexport PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATHexport HADOOP_INSTALL=/home/hongchq/tools/hadoop-1.0.3export PATH=$HADOOP_INSTALL/bin:$PATHexport CLASSPATH=$HADOOP_INSTALL/hadoop-tools-1.0.3.jar:$HADOOP_INSTALL/hadoop-core-1.0.3.jar:$HADOOP_INSTALL/hadoop-client-1.0.3.jar:$HADOOP_INSTALL/lib:$CLASSPATHexport HADOOP_HOME=/home/hongchq/tools/hadoop-1.0.3export HADOOP_CLASSPATH=$HADOOP_HOME/lib:$HADOOP_INSTALL/hadoop-tools-1.0.3.jar:$HADOOP_INSTALL/hadoop-core-1.0.3.jar:$HADOOP_INSTALL/hadoop-client-1.0.3.jarexport HIVE_HOME=/home/hongchq/tools/hive-0.9.0export PATH=$HIVE_HOME/bin:$PATHexport CLASSPATH=$HIVE_HOME/lib:$CLASSPATH然后hive的conf下使用的hive-env.conf没有修改,默认配置。然后测试,执行hive命令,提示错误如下:hongchq@Ubuntu1:~/tools/hive-0.9.0/conf$ hiveException in thread "main" java.lang.NoClassDefFoundError: org/apache/thrift/TException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:247) at org.apache.hadoop.util.RunJar.main(RunJar.java:149)Caused by: java.lang.ClassNotFoundException: org.apache.thrift.TException at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) ... 3 more请问下是什么原因呢?
使用的hadoop是1.0.3版本,hive是0.9.0版本

参考技术A 对比$HADOOP_HOME/lib下的jar包和$HIVE_HOME/lib下的jia包,将hadoop下缺少的jar包从hive下找到并复制过去,再启动hive 参考技术B 少了libthrift这个jar包

SpringBoot解决Build失败,提示 程序包xxx不存在 找不到符号

一、程序包xxx不存在 找不到符号

我在引入依赖之后,写了个工具类,然后运行发现build失败了。

提示 程序包xxx不存在 找不到符号

二、解决方案

mvn idea:idea
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/johnzon/johnzon-maven-plugin/1.2.15/johnzon-maven-plugin-1.2.15.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/johnzon/johnzon-maven-plugin/1.2.15/johnzon-maven-plugin-1.2.15.pom (4.0 kB at 3.2 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/johnzon/johnzon/1.2.15/johnzon-1.2.15.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/johnzon/johnzon/1.2.15/johnzon-1.2.15.pom (27 kB at 55 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/johnzon/johnzon-maven-plugin/1.2.15/johnzon-maven-plugin-1.2.15.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/johnzon/johnzon-maven-plugin/1.2.15/johnzon-maven-plugin-1.2.15.jar (31 kB at 58 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-idea-plugin/maven-metadata.xml
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-idea-plugin/maven-metadata.xml (471 B at 1.3 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-idea-plugin/2.2.1/maven-idea-plugin-2.2.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-idea-plugin/2.2.1/maven-idea-plugin-2.2.1.pom (6.6 kB at 16 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-idea-plugin/2.2.1/maven-idea-plugin-2.2.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-idea-plugin/2.2.1/maven-idea-plugin-2.2.1.jar (54 kB at 117 kB/s)
[INFO] 
[INFO] -------------------< com.metaxiaoyu:SpringBoot-JWT >--------------------
[INFO] Building SpringBoot-JWT 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] >>> maven-idea-plugin:2.2.1:idea (default-cli) > generate-resources @ SpringBoot-JWT >>>
[INFO] 
[INFO] <<< maven-idea-plugin:2.2.1:idea (default-cli) < generate-resources @ SpringBoot-JWT <<<
[INFO] 
[INFO] 
[INFO] --- maven-idea-plugin:2.2.1:idea (default-cli) @ SpringBoot-JWT ---
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.1/maven-plugin-api-2.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.1/maven-plugin-api-2.0.1.pom (643 B at 1.7 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.1/maven-2.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven/2.0.1/maven-2.0.1.pom (11 kB at 29 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.1/maven-project-2.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.1/maven-project-2.0.1.pom (1.7 kB at 4.6 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.1/maven-profile-2.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.1/maven-profile-2.0.1.pom (1.5 kB at 4.0 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.1/maven-model-2.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.1/maven-model-2.0.1.pom (2.5 kB at 6.7 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.0.5/plexus-utils-1.0.5.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.0.5/plexus-utils-1.0.5.pom (918 B at 2.4 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.1/maven-artifact-manager-2.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.1/maven-artifact-manager-2.0.1.pom (1.4 kB at 3.7 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.1/maven-repository-metadata-2.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.1/maven-repository-metadata-2.0.1.pom (1.3 kB at 3.5 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.1/maven-artifact-2.0.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.1/maven-artifact-2.0.1.pom (765 B at 2.1 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.pom
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.pom (4.6 kB at 12 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/dom4j/dom4j/1.6.1/dom4j-1.6.1.pom
Downloaded from central: https://repo.maven.apache.org/maven2/dom4j/dom4j/1.6.1/dom4j-1.6.1.pom (6.8 kB at 18 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.1/maven-plugin-api-2.0.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.1/maven-project-2.0.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.1/maven-profile-2.0.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.1/maven-artifact-2.0.1.jar
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.1/maven-artifact-manager-2.0.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0.1/maven-plugin-api-2.0.1.jar (8.2 kB at 22 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.1/maven-repository-metadata-2.0.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0.1/maven-profile-2.0.1.jar (30 kB at 39 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.1/maven-model-2.0.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0.1/maven-repository-metadata-2.0.1.jar (20 kB at 25 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-container-default/1.0-alpha-9/plexus-container-default-1.0-alpha-9.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0.1/maven-artifact-2.0.1.jar (78 kB at 80 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0.1/maven-artifact-manager-2.0.1.jar (49 kB at 49 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0.1/maven-project-2.0.1.jar (105 kB at 95 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0.1/maven-model-2.0.1.jar (80 kB at 60 kB/s)
Downloading from central: https://repo.maven.apache.org/maven2/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar
Downloaded from central: https://repo.maven.apache.org/maven2/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar (52 kB at 36 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-container-default/1.0-alpha-9/plexus-container-default-1.0-alpha-9.jar (195 kB at 125 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar (169 kB at 106 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar (109 kB at 62 kB/s)
Downloaded from central: https://repo.maven.apache.org/maven2/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar (314 kB at 163 kB/s)
[INFO] Not adding resource directory as it has an incompatible target path or filtering: /Users/lixiaoyu/onedrive/code/gs-securing-web/SpringBoot-JWT/src/main/resources
[INFO] jdkName is not set, using [java version1.8.0_311] as default.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  10.982 s
[INFO] Finished at: 2021-11-22T17:42:50+08:00
[INFO] ------------------------------------------------------------------------

再次运行,显示build成功。

三、总结

遇到引入依赖后,还是提示没找到,就执行mvn idea:idea

以上是关于hive安装失败,提示找不到类 org/apache/thrift/TException的主要内容,如果未能解决你的问题,请参考以下文章

SpringBoot解决Build失败,提示 程序包xxx不存在 找不到符号

VS2012安装失败,提示visual studio 2012 prerequisites找不到申请的对象

无法使用 Hive 支持实例化 SparkSession,因为找不到 Hive 类 [重复]

Linux下安装mysql失败,提示找不到mysqld.sock

Error:(37, 47) java: 无法访问org.apache.hadoop.mapred.JobConf 找不到org.apache.hadoop.mapred.JobConf的类文件(

Visual Studio 编译项目失败,提示找不到文件