本文介绍了org.apache.hive.service.cli.HiveSQLException:java.lang.NoClassDefFoundError:org/apache/hadoop/ipc/CallerContext $ Builder的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将我的蜂巢jdbc客户端连接到hiveserver2. 我正在使用以下Maven
I am trying to connect my hive jdbc client to hiveserver2. i am using following maven
<dependency>
<groupId>org.apache.hive</groupId>
<artifactId>hive-service</artifactId>
<version>1.2.1000.2.4.2.12-1</version>
</dependency>
hiveserver2.start() started my hiveserver2.
但是当我使用以下代码启动我的jdbc客户端时:
but when i start my jdbc client with followin code :
val con: Connection = DriverManager
.getConnection("jdbc:hive2://localhost:10000/default", "", "")
val stmt: Statement = con.createStatement
stmt.execute("create table if not exists student (id int))
它给了我以下异常:
任何人都可以帮助我确定此原因或解决方案的原因.
Can anybody either help me to identify the reason of this or solution please.
谢谢.
推荐答案
这可能由于多种原因而发生:-
This could happen due to multiple reason:-
- 相应的jar将不可用,即具有正确版本的hivejdbcdriver jar,例如:"hive-jdbc-1.2.1.jar"有时您可能会使用"hive-jdbc-1.2.1-standalone.jar"(取决于您的用例方式是)在librarys文件夹或.m2存储库中.
- 或者,它也可以如果罐子可能没有添加到您的类路径中(为此添加一个条目.classpath文件中的jar),具体取决于应用程序的方式内置的.
- Either the corresponding jar wont be available which is thehivejdbcdriver jar with the right version eg: "hive-jdbc-1.2.1.jar"or sometimes you may to use"hive-jdbc-1.2.1-standalone.jar"(depending upon on how your usecaseis) in the libraries folder or .m2 repository.
- Or,it could alsobe the jar may not be added in your classpath(add an entry for thisjar in your .classpath file), depending upon how your application isbuilt.
这篇关于org.apache.hive.service.cli.HiveSQLException:java.lang.NoClassDefFoundError:org/apache/hadoop/ipc/CallerContext $ Builder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!