CDH5之Found class jline.Terminal, but interface was expected
公司CDH5叢集已經部署完畢,需要透過web介面新增hive元件,一般來說透過web介面來新增,會報兩個錯誤,
一個是配置hive的後設資料的/usr/share/java/mysql-connector-java.jar驅動包,
還有一個錯誤就是如圖:
二.錯誤明細:
++ exec /opt/cloudera/parcels/CDH/lib/hadoop/bin/hadoop jar /opt/cloudera/parcels/CDH/lib/hive/lib/hive-cli-1.1.0-cdh5.4.8.jar org.apache.hive.beeline.HiveSchemaTool -verbose -dbType mysql -initSchema
[ERROR] Terminal initialization failed; falling back to unsupported
java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
at jline.TerminalFactory.create(TerminalFactory.java:101)
at jline.TerminalFactory.get(TerminalFactory.java:159)
at org.apache.hive.beeline.BeeLineOpts.(BeeLineOpts.java:74)
at org.apache.hive.beeline.BeeLine.(BeeLine.java:119)
at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:346)
at org.apache.hive.beeline.HiveSchemaTool.runBeeLine(HiveSchemaTool.java:326)
at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:266)
at org.apache.hive.beeline.HiveSchemaTool.doInit(HiveSchemaTool.java:243)
at org.apache.hive.beeline.HiveSchemaTool.main(HiveSchemaTool.java:473)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
三.錯誤分析:
1. ++ exec /opt/cloudera/parcels/CDH/lib/hadoop/bin/hadoop jar /opt/cloudera/parcels/CDH/lib/hive/lib/hive-cli-1.1.0-cdh5.4.8.jar org.apache.hive.beeline.HiveSchemaTool -verbose -dbType mysql -initSchema
這句是配置hive元件的後設資料庫是mysql,在初始化hive的schema,也就是儲存後設資料的表呀等等,所以這句對於我們沒有用
這句說初始化schema失敗,回退到不支援,這句也沒有給出很明顯的錯誤,所以看第三句
3.java.lang.IncompatibleClassChangeError: Found class jline.Terminal, but interface was expected
第三句說明發現類jline.Terminal,但是介面是過期的。初步懷疑是jline的jar版本太低。
四.解決方案:
hadoop-hdfs目錄下存在老版本jline,將hive下的新版本jline的JAR包複製到hadoop-hdfs下
1.進入hive/lib目錄檢視jline版本和檔案的所在位置
[root@alish1-xxx-01 ~]# cd /opt/cloudera/parcels/CDH-5.4.8-1.cdh5.4.8.p0.4/lib/hive/lib
[root@alish1-xxx-01 lib]# ll jline*
lrwxrwxrwx 1 root root 28 Apr 9 17:05 jline-2.12.jar -> ../../../jars/jline-2.12.jar
2.進入CDH叢集的jar包資料夾,檢視jline包,一看有四個版本,最新的是2.12
[root@alish1-xxx-01 lib]# cd ../../../jars/
[root@alish1-xxx-01 jars]# ll jline*
-rwxr-xr-x 1 root root 87249 Oct 16 01:36 jline-0.9.94.jar
-rw-r--r-- 1 root root 164623 Oct 16 01:36 jline-2.10.4.jar
-rw-r--r-- 1 root root 206202 Oct 16 01:33 jline-2.11.jar
-rw-r--r-- 1 root root 213854 Oct 16 01:32 jline-2.12.jar
3.find一下jline包哪些元件會有
[root@alish1-xxx-01 ~]# find / -name jline*
/opt/cloudera/parcels/CDH/lib/crunch/lib/jline-2.10.4.jar
/opt/cloudera/parcels/CDH/lib/llama/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/flume-ng/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/libtools/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-mr1/lib/pig/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-mr1/lib/hive/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-mr1/lib/hive2/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-mr1/lib/sqoop/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-mr1/lib/hcatalog/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/libserver/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-yarn/lib/pig/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-yarn/lib/hive/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-yarn/lib/hive2/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-yarn/lib/sqoop/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/oozie/oozie-sharelib-yarn/lib/hcatalog/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/hadoop-0.20-mapreduce/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/impala/lib/jline-2.12.jar
/opt/cloudera/parcels/CDH/lib/sentry/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/hive/lib/jline-2.12.jar
/opt/cloudera/parcels/CDH/lib/hadoop-httpfs/webapps/webhdfs/WEB-INF/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/whirr/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/hadoop-hdfs/lib/jline-0.9.94.jar
/opt/cloudera/parcels/CDH/lib/sqoop2/client-lib/jline-0.9.94.jar
/opt/cloudera/parcels/CDH/lib/hadoop-kms/webapps/kms/WEB-INF/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/zookeeper/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/lib/hadoop-yarn/lib/jline-2.11.jar
/opt/cloudera/parcels/CDH/jars/jline-2.12.jar
/opt/cloudera/parcels/CDH/jars/jline-2.11.jar
/opt/cloudera/parcels/CDH/jars/jline-2.10.4.jar
/opt/cloudera/parcels/CDH/jars/jline-0.9.94.jar
###透過觀察發現,/opt/cloudera/parcels/CDH/lib/hadoop-hdfs/lib/jline-0.9.94.jar,這個路徑的jar版本過低,才0.9.94版本,所以要替換為最新的版本2.12
(hive元件的最終建立表的資料還是會存在hdfs檔案系統上.肯定就是替換一下就行);
###而sqoop2元件我沒有安裝,所以不需要替換!
4.cp 最新jline包
[root@alish1-xxx-01 ~]# cp /opt/cloudera/parcels/CDH/jars/jline-2.12.jar /opt/cloudera/parcels/CDH/lib/hadoop-hdfs/lib/
[root@alish1-xxx-01 ~]# cp /opt/cloudera/parcels/CDH/lib/hadoop-hdfs/lib/jline-0.9.94.jar /opt/cloudera/parcels/CDH/lib/hadoop-hdfs/lib/jline-0.9.94.jar.bak
[root@alish1-xxx-01 ~]#
五.驗證結果:
單擊web安裝介面的"重試"按鈕,it's ok!!!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30089851/viewspace-2082146/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- golang expected declaration, found 'IDENT'GolangIDE
- Typescript的interface、class和abstract classTypeScript
- C# interface abstract classC#
- 開發:異常收集之 expected single matching bean but found 2Bean
- 每日充電:踩坑expected ‘package‘, found ‘import‘PackageImport
- Android:Unexpected lock protocol found in lock file. Expected 3, found 0.AndroidProtocol
- CDH5之TrashH5
- TypeScript中,type、interface、class的區別TypeScript
- WebService異常Unexpected wrapper element ... found. Expected ...WebAPP
- ***報錯Class 'Redis' not found in(原創)Redis
- 使用URLClassLoader報錯not class found exceptionException
- PyTorch出現錯誤“RuntimeError: Found dtype Double but expected Float”PyTorchError
- Go 執行 程式 test.go:1:1: expected ‘package‘, found ‘EOF‘GoPackage
- PHP中的 抽象類(abstract class)和 介面(interface)PHP抽象
- PHP 中的抽象類(abstract class)和介面(interface)PHP抽象
- Golang之interfaceGolang
- java之介面interfaceJava
- CDH5之Exhausted available authentication methodsH5AI
- Lumen 報錯 : Class 'League\Flysystem\Adapter\Local' not foundAPT
- Eclipse 啟動專案錯誤:class not foundEclipse
- [Symfony\Component\Debug\Exception\FatalThrowableError] Class 'LaravelLocalization' not foundExceptionErrorLaravel
- kattle Driver class 'oracle.jdbc.driver.OracleDriver' could not be foundOracleJDBC
- expected '', but found BlockMappingStart in 'reader', line 13, column 1:nimbus.host:BloCAPP
- c# interface介面之C#
- Error:Could not determine the class-path for interface com.android.builder.modelErrorAndroidUI
- sql列別名引發ORA-00923: FROM keyword not found where expectedSQL
- Symfony\Component\Debug\Exception\FatalThrowableError Class 'Lcobucci\JWT\Builder' not foundExceptionErrorJWTUI
- ntpq無法查詢同步資訊,顯示The specified class was not found
- JAVA SSH與Class 'org.apache.commons.dbcp.BasicDataSource' not foundJavaApache
- thinkphp ventor引入第三方類庫 class not foundPHP
- No serializer found for class org.apache.ibatis.executor.loader.javassist.JavassistProxyFactory...ApacheBATJava
- JNI開發:Class android.content.Context could not be foundAndroidContext
- 關於在Interface和Abstract Class間選擇的一些思考
- TypeScript 之 Class(上)TypeScript
- TypeScript 之 Class(下)TypeScript
- CDH5之Unexpected error.Unable to verify database connectionH5ErrorDatabase
- Ubuntu 20.04 安裝 php-xml 模組(報錯:Class 'DOMDocument' not found )UbuntuPHPXML
- 深入理解Golang之interface和reflectGolang