1. 程式人生 > >spark中出現org.apache.htrace找不到的錯誤

spark中出現org.apache.htrace找不到的錯誤

在CDH中,開發的spark連線Hbase的時候,往往會出現找不到org.apache.htrace包。


具體錯誤如下:
? ? ? ERROR TableInputFormat: java.io.IOException:?
? ? ? java.lang.reflect.InvocationTargetException
? ? ?Caused by: java.lang.NoClassDefFoundError: org/apache/htrace/Trace
? ? ?Caused by: java.lang.ClassNotFoundException: org.apache.htrace.Trace


問題原因:
CDH的Spark的classpath中引入的是/opt/cloudera/parcels/CDH/jars/htrace-core-3.0.4.jar,而這個版本的時候,htrace還是org.htrace,而3.1.0的時候已經貢獻給Apache了,改叫org.apache.htrace了。


解決方法:
方法一:手動修改作業提交機器的/etc/alternatives/spark-conf/classpath.txt,在最後添上/opt/cloudera/parcels/CDH-5.4.8-1.cdh5.4.8.p0.4/jars/htrace-core-3.1.0-incubating.jar即可。(個人推薦使用)
方法二:通過提交命令的方式提交引數--conf spark.executor.extraClassPath;
#!/bin/bash
HBASE_HOME=/opt/cloudera/parcels/CDH/lib/hbase
SPARK_CLASSPATH="$HBASE_HOME/conf/:$HBASE_HOME/hbase-client.jar:$HBASE_HOME/hbase-protocol.jar:$HBASE_HOME/lib/htrace-core.jar:$HBASE_HOME/lib/htrace-core-3.1.0-incubating.jar"
spark-submit --conf spark.executor.extraClassPath=$SPARK_CLASSPATH --class com.test.Main ?test-jar-with-dependencies.jar


另外一個CDH上:
/opt/cloudera/parcels/CDH/jars/htrace-core-2.00.jar
/opt/cloudera/parcels/CDH/jars/htrace-core-3.2.0-incubating.jar
/opt/cloudera/parcels/CDH/jars/htrace-core4-4.0.1-incubating.jar


/etc/alternatives/spark-conf/classpath.txt檔案中:

183 /opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/jars/htrace-core-3.2.0-incubating.jar
184 /opt/cloudera/parcels/CDH-5.5.1-1.cdh5.5.1.p0.11/jars/htrace-core4-4.0.1-incubating.jar


[[email protected] jars]# jar -tf htrace-core-3.2.0-incubating.jar | grep Trace.
org/apache/htrace/HTraceConfiguration$MapConf.class
org/apache/htrace/HTraceConfiguration.class
org/apache/htrace/Trace.class
org/apache/htrace/TraceInfo.class
org/apache/htrace/Tracer$1.class
org/apache/htrace/Tracer$TracerHolder.class
org/apache/htrace/Tracer.class
org/apache/htrace/TraceScope.class
org/apache/htrace/TraceTree$SpansByParent$1.class
org/apache/htrace/TraceTree$SpansByParent.class
org/apache/htrace/TraceTree$SpansByProcessId$1.class
org/apache/htrace/TraceTree$SpansByProcessId.class
org/apache/htrace/TraceTree.class
org/apache/htrace/wrappers/TraceCallable.class
org/apache/htrace/wrappers/TraceExecutorService.class
org/apache/htrace/wrappers/TraceProxy$1.class
org/apache/htrace/wrappers/TraceProxy.class
org/apache/htrace/wrappers/TraceRunnable.class
org/apache/htrace/fasterxml/jackson/databind/deser/std/StackTraceElementDeserializer.class
[
[email protected]
jars]# jar -tf htrace-core4-4.0.1-incubating.jar | grep Trace.
org/apache/htrace/core/Tracer$ThreadLocalContext.class
org/apache/htrace/core/TraceRunnable.class
org/apache/htrace/core/TracerPool.class
org/apache/htrace/core/Tracer.class
org/apache/htrace/core/Tracer$1.class
org/apache/htrace/core/HTraceConfiguration.class
org/apache/htrace/core/Tracer$ThreadContext.class
org/apache/htrace/core/TraceScope.class
org/apache/htrace/core/TraceCallable.class
org/apache/htrace/core/HTraceConfiguration$MapConf.class
org/apache/htrace/core/TraceExecutorService.class
org/apache/htrace/core/TracerId.class
org/apache/htrace/core/Tracer$Builder.class
org/apache/htrace/core/TracerPool$SpanReceiverShutdownHook.class
org/apache/htrace/fasterxml/jackson/databind/deser/std/StackTraceElementDeserializer.class
[
[email protected]
jars]# jar -tf htrace-core-2.00.jar | grep Trace.
org/cloudera/htrace/HTraceConfiguration$MapConf.class
org/cloudera/htrace/HTraceConfiguration.class
org/cloudera/htrace/Trace.class
org/cloudera/htrace/TraceInfo.class
org/cloudera/htrace/Tracer$1.class
org/cloudera/htrace/Tracer.class
org/cloudera/htrace/TraceScope.class
org/cloudera/htrace/TraceTree.class
org/cloudera/htrace/wrappers/TraceCallable.class
org/cloudera/htrace/wrappers/TraceExecutorService.class
org/cloudera/htrace/wrappers/TraceProxy$1.class
org/cloudera/htrace/wrappers/TraceProxy.class
org/cloudera/htrace/wrappers/TraceRunnable.class


本測試環境:
/opt/cloudera/parcels/CDH/jars/htrace-core-2.00.jar
/opt/cloudera/parcels/CDH/jars/htrace-core-3.0.4.jar
/opt/cloudera/parcels/CDH/jars/htrace-core-3.1.0-incubating.jar


/etc/alternatives/spark-conf/classpath.txt檔案中:
41 /opt/cloudera/parcels/CDH-5.4.5-1.cdh5.4.5.p0.7/jars/htrace-core-3.0.4.jar




[[email protected] jars]$ jar -tf htrace-core-2.00.jar | grep Trace.
org/cloudera/htrace/HTraceConfiguration$MapConf.class
org/cloudera/htrace/HTraceConfiguration.class
org/cloudera/htrace/Trace.class
org/cloudera/htrace/TraceInfo.class
org/cloudera/htrace/Tracer$1.class
org/cloudera/htrace/Tracer.class
org/cloudera/htrace/TraceScope.class
org/cloudera/htrace/TraceTree.class
org/cloudera/htrace/wrappers/TraceCallable.class
org/cloudera/htrace/wrappers/TraceExecutorService.class
org/cloudera/htrace/wrappers/TraceProxy$1.class
org/cloudera/htrace/wrappers/TraceProxy.class
org/cloudera/htrace/wrappers/TraceRunnable.class
[[email protected] jars]$ jar -tf htrace-core-3.0.4.jar | grep Trace
org/htrace/HTraceConfiguration$MapConf.class
org/htrace/HTraceConfiguration.class
org/htrace/Trace.class
org/htrace/TraceInfo.class
org/htrace/TraceScope.class
org/htrace/TraceTree.class
org/htrace/Tracer$1.class
org/htrace/Tracer$TracerHolder.class
org/htrace/Tracer.class
org/htrace/wrappers/TraceCallable.class
org/htrace/wrappers/TraceExecutorService.class
org/htrace/wrappers/TraceProxy$1.class
org/htrace/wrappers/TraceProxy.class
org/htrace/wrappers/TraceRunnable.class
[[email protected] jars]$ jar -tf htrace-core-3.1.0-incubating.jar | grep Trace
org/apache/htrace/HTraceConfiguration$MapConf.class
org/apache/htrace/HTraceConfiguration.class
org/apache/htrace/Trace.class
org/apache/htrace/TraceInfo.class
org/apache/htrace/Tracer$1.class
org/apache/htrace/Tracer$TracerHolder.class
org/apache/htrace/Tracer.class
org/apache/htrace/TraceScope.class
org/apache/htrace/TraceTree$SpansByParent$1.class
org/apache/htrace/TraceTree$SpansByParent.class
org/apache/htrace/TraceTree$SpansByProcessId$1.class
org/apache/htrace/TraceTree$SpansByProcessId.class
org/apache/htrace/TraceTree.class
org/apache/htrace/wrappers/TraceCallable.class
org/apache/htrace/wrappers/TraceExecutorService.class
org/apache/htrace/wrappers/TraceProxy$1.class
org/apache/htrace/wrappers/TraceProxy.class
org/apache/htrace/wrappers/TraceRunnable.class
org/apache/htrace/fasterxml/jackson/databind/deser/std/StackTraceElementDeserializer.class

相關推薦

spark出現org.apache.htrace到的錯誤

在CDH中,開發的spark連線Hbase的時候,往往會出現找不到org.apache.htrace包。 具體錯誤如下: ? ? ? ERROR TableInputFormat: java.io.IOException:? ? ? ? java.lang.reflect.

關於Service方法呼叫時出現org.apache.ibatis.binding.BindingException錯誤的可能原因

專案是SpringBoot + Mybatis構建的。關鍵元件版本如下:<parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-bo

Hive執行過程出現Caused by : java.lang.ClassNotFoundException: org.cloudera.htrace.Trace的錯誤解決辦法(圖文詳解)

pre wid logs In 實用 過程 ase edit 微信     不多說,直接上幹貨! 問題詳情     如下   這個錯誤的意思是缺少 htrace-core-2.04.jar。  解決辦法:   

R讀取文件,到路徑問題 No such file or directory

con tracking air csdn rac rect 路徑 路徑和 data R中讀取文件,找不到路徑問題 No such file or directory 近日,讀取文件時。出現例如以下問題 > passenger = read.c

Hbase 出現 org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet 錯誤

hadoop nbsp mode sta oop proto 出現 method cep ERROR: org.apache.hadoop.hbase.ipc.ServerNotRunningYetException: Server is not running yet

Driver stacktrace: at org.apache.spark.scheduler.DAGScheduler.org$apache$spark$scheduler$DAGSchedul

depend trace pan ssi ram rac .org driver 過大 在寫Spark程序是遇到問題 Driver stacktrace: at org.apache.spark.scheduler.DAGScheduler.orgapachea

org.jsoup.Jsoup到jar包問題解決思路

pid clas repos 圖片 png 解決 dea 題解 項目 今天在idea中導入項目,出現了這樣的問題 通過idea的自帶的導包功能,卻提示找不到這個東西.於是就去maven倉庫搜索這個咚咚 <!-- https://mvnrepository.com/

記一次解決cmd執行java提示"到或無法加載主類"的問題

提示 .com nbsp 大小寫 環境變量 spa 文件中 .exe 輸入 今天遇到一個問題:在cmd命令行中,用javac編譯java文件可以成功,但是用java執行卻提示“找不到或無法加載主類”。現將該問題的原因以及解決辦法記錄一下。 先理解一下系統變量path和cla

解決mybatisorg.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

解決mybatis中的org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)問題: 1、檢查mapper.xml與mapper.java的namespace中的名字是否相符合; 2、檢

SpringBoot整合Mybatis註解版---update出現org.apache.ibatis.binding.BindingException: Parameter 'XXX' not found. Available parameters are [arg1, arg0,

SpringBoot整合Mybatis註解版---update時出現的問題 問題描述:   1、sql建表語句 DROP TABLE IF EXISTS `department`; CREATE TABLE `department` ( `id` int(11) NOT NULL AUTO_I

java.lang.ClassNotFoundException: org.apache.htrace.SamplerBuilder

報錯 aused by: java.lang.ClassNotFoundException: org.apache.htrace.SamplerBuilder at java.net.URLClassLoader.findClass(URLClassLoader.java:3

eclipse 程序包org.apache.axis.client存在

clip 不存在 原因 org ips axis bubuko lips 分享   在普通的 java 項目中引入jar後運行報錯:程序包org.apache.axis.client不存在      原因是多引入了一個非jar文件log4j.properties,如下:

android studiosetContentView時R.layout 到已存在的佈局檔案

在res/layout 資料夾內已經寫好了佈局檔案:XXX_layout.xml,但是在activity裡寫setContentView(R.layout.……)的時候,不會提示XXX_layout,而且,自己手動填寫了XXX_layout,還會報錯,找不到該佈局檔案。查詢資料後,順利解決問題,隨手

eclipse專案當使用註解時到類,

今天遇到一個奇怪的問題,在pom.xml 中匯入下面的jar包 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>s

AS使用xUtils報錯

AndroidStudio出現的錯誤 錯誤如下 解決方法 開啟對應module的build.gradle檔案 將 useLibrary ‘org.apache.http.legacy’ 將這一行程式碼新增到android{}

出現org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)時怎麼解決

當出現org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)時怎麼解決 這是樓主遇見的錯誤用maven整合ssm的時候出現的。出現這種錯誤的原因分析: 1、dao和mapper裡

SpringBoot整合Mybatis註解版---update出現org.apache.ibatis.binding.BindingException: Parameter 'XXX' not found. Available parameters are

SpringBoot整合Mybatis註解版---update時出現的問題 問題描述: 1、sql建表語句 DROP TABLE IF EXISTS `department`; CREATE TABLE `department` ( `id` int(11) NOT NULL AUTO_INCREMEN

解決Android 5.0以下出現 java.lang.NoClassDefFoundError,到類

本文參考自:http://www.jianshu.com/p/8b4f711da0bb 問題的主要原因:方法數超65536限制。 由於實際開發當中的需求不斷變更,開源框架越來越多,大多都用第三方SDK,導致方法數很容易超出65536限制。出現錯誤java.lang.NoClassDe

pom出現org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.

Maven匯入專案的時候,pom.xml出現:org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.M

VideoWriter類關於CV_FOURCC與CV_CAP_PROP_FRAME_COUNT到識別符號的問題

一般可能是配置chul出了問題,需新增標頭檔案 #include<opencv\highgui.h> 樓主只新增 #include <opencv2\opencv.hpp> 標頭檔案時,任然報錯。(頭大) https://blog.csdn.net/dengshuai