org.apache.hive.service.cli.HiveSQLException:java.lang.NoClassDefFoundError:org/apache/hadoop/ipc/CallerContext $ Builder [英] org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/ipc/CallerContext$Builder

查看:676
本文介绍了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))

它给了我以下异常:

org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/ipc/CallerContext $ Builder位于 org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:256)在 org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:242)在 org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254)

org.apache.hive.service.cli.HiveSQLException: java.lang.NoClassDefFoundError: org/apache/hadoop/ipc/CallerContext$Builder at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:256) at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:242) at org.apache.hive.jdbc.HiveStatement.execute(HiveStatement.java:254)

任何人都可以帮助我确定此原因或解决方案的原因.

Can anybody either help me to identify the reason of this or solution please.

谢谢.

推荐答案

这可能由于多种原因而发生:-

This could happen due to multiple reason:-

  1. 相应的jar将不可用,即 具有正确版本的hivejdbcdriver jar,例如:"hive-jdbc-1.2.1.jar" 有时您可能会使用 "hive-jdbc-1.2.1-standalone.jar"(取决于您的用例方式 是)在librarys文件夹或.m2存储库中.
  2. 或者,它也可以 如果罐子可能没有添加到您的类路径中(为此添加一个条目 .classpath文件中的jar),具体取决于应用程序的方式 内置的.
  1. Either the corresponding jar wont be available which is the hivejdbcdriver 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 usecase is) in the libraries folder or .m2 repository.
  2. Or,it could also be the jar may not be added in your classpath(add an entry for this jar in your .classpath file), depending upon how your application is built.

这篇关于org.apache.hive.service.cli.HiveSQLException:java.lang.NoClassDefFoundError:org/apache/hadoop/ipc/CallerContext $ Builder的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆