簡體   English   中英

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

我正在嘗試將我的hive jdbc客戶端連接到hiveserver2。 我正在使用以下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客戶端時:

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:org上的org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:256)中的java.lang.NoClassDefFoundError:org / apache / hadoop / ipc / CallerContext $ Builder org.apache.hive.jdbc.HiveStatement.execute中的.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:242)(HiveStatement.java:254)

任何人都可以幫助我找出這個或解決方案的原因。

提前致謝。

這可能由於多種原因而發生: -

  1. 相應的jar將不可用,這是具有正確版本的hivejdbcdriver jar,例如:“hive-jdbc-1.2.1.jar”或有時您可能使用“hive-jdbc-1.2.1-standalone.jar”(取決於關於你的用例是如何)在libraries文件夾或.m2存儲庫中。
  2. 或者,也可能是jar類可能未添加到類路徑中(在.classpath文件中為此jar添加條目),具體取決於應用程序的構建方式。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM