java.lang.IllegalAccessError: class com.google.protobuf.HBaseZeroCopyByteString

hadoop mr 或者 spark 操作 hbase时候就出现这个错误

这是hbase的bug,可在jira上看到该问题:https://issues.apache.org/jira/browse/HBASE-10304

报错信息:

15/08/17 19:28:33 ERROR yarn.ApplicationMaster: User class threw exception: org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.IllegalAccessError: class com.google.protobuf.HBaseZeroCopyByteString ca
nnot access its superclass com.google.protobuf.LiteralByteString
org.apache.hadoop.hbase.DoNotRetryIOException: java.lang.IllegalAccessError: class com.google.protobuf.HBaseZeroCopyByteString cannot access its superclass com.google.protobuf.LiteralByteString
        at org.apache.hadoop.hbase.client.RpcRetryingCaller.translateException(RpcRetryingCaller.java:210)
        at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:121)
        at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:90)
        at org.apache.hadoop.hbase.client.ClientScanner.nextScanner(ClientScanner.java:264)
        at org.apache.hadoop.hbase.client.ClientScanner.initializeScannerInConstruction(ClientScanner.java:169)
        at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:164)
        at org.apache.hadoop.hbase.client.ClientScanner.<init>(ClientScanner.java:107)
        at org.apache.hadoop.hbase.client.HTable.getScanner(HTable.java:736)
        at org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:178)
        at org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:82)
        at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.isTableAvailable(HConnectionManager.java:962)
        at org.apache.hadoop.hbase.client.HBaseAdmin.isTableAvailable(HBaseAdmin.java:1081)
        at org.apache.hadoop.hbase.client.HBaseAdmin.isTableAvailable(HBaseAdmin.java:1089)
        at com.umeng.dp.yuliang.play.HBaseToES$.main(HBaseToES.scala:28)
        at com.umeng.dp.yuliang.play.HBaseToES.main(HBaseToES.scala)
        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.spark.deploy.yarn.ApplicationMaster$$anon$2.run(ApplicationMaster.scala:483)
Caused by: java.lang.IllegalAccessError: class com.google.protobuf.HBaseZeroCopyByteString cannot access its superclass com.google.protobuf.LiteralByteString
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at org.apache.hadoop.hbase.protobuf.RequestConverter.buildRegionSpecifier(RequestConverter.java:930)
        at org.apache.hadoop.hbase.protobuf.RequestConverter.buildScanRequest(RequestConverter.java:434)
        at org.apache.hadoop.hbase.client.ScannerCallable.openScanner(ScannerCallable.java:297)
        at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:157)
        at org.apache.hadoop.hbase.client.ScannerCallable.call(ScannerCallable.java:57)
        at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:114)
        ... 18 more

hadoop yarn 解决方案:

  1. 提交作业方式

    $ export HADOOP_CLASSPATH="/home/cluster/apps/hbase/lib/hbase-protocol-0.98.1-cdh5.1.0.jar"
    $ ./hadoop-2.2.0/bin/hadoop --config /home/stack/conf_hadoop/ jar ./hbase/hbase-assembly/target/hbase-0.99.0-SNAPSHOT-job.jar  org.apache.hadoop.hbase.mapreduce.RowCounter usertable
  2. 增加HADOOP_CLASSPATH到linux环境变量中

    增加如下内容到bashrc 或者 bash_profile 或者 profile ,这样是linux环境变量中就行

    export HADOOP_CLASSPATH=$HADOOP_CLASSPATH:/home/cluster/apps/hbase/lib/hbase-protocol-0.98.1-cdh5.1.0.jar

spark 解决方案:

  1. 提交作业方式

    -conf 增加spark.driver.extraClassPath & spark.executor.extraClassPath

    spark-submit --class com.umeng.dp.yuliang.play.HBaseToES --master yarn-cluster --conf "spark.driver.extraClassPath=/home/cluster/apps/hbase/lib/hbase-protocol-0.98.1-cdh5.1.0.jar" --conf "spark.executor.extraClassPath=/home/cluster/apps/hbase/lib/hbase-protocol-0.98.1-cdh5.1.0.jar"   --jars /home/cluster/apps/hbase/lib/hbase-protocol-0.98.1-cdh5.1.0.jar ScalaMR-0.0.1-jar-with-dependencies.jar 
  2. 增加如下配置到$SPARK_HOME/conf/spark-defaults.conf文件
    spark.driver.extraClassPath /home/cluster/apps/hbase/lib/hbase-protocol-0.98.1-cdh5.1.0.jar
    spark.executor.extraClassPath /home/cluster/apps/hbase/lib/hbase-protocol-0.98.1-cdh5.1.0.jar
    

spark maillist:

http://apache-spark-user-list.1001560.n3.nabble.com/java-lang-IllegalAccessError-class-com-google-protobuf-HBaseZeroCopyByteString-cannot-access-its-supg-tc24303.html

尊重原创,未经允许不得转载:

http://blog.csdn.net/stark_summer/article/details/47750017

版权声明:本文为博主原创文章,未经博主允许不得转载。

时间: 2024-11-05 12:26:22

java.lang.IllegalAccessError: class com.google.protobuf.HBaseZeroCopyByteString的相关文章

java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory

java.lang.IllegalAccessError: tried to access field org.slf4j.impl.Static.. java.lang.IllegalAccessError: tried to access field org.slf4j.impl.StaticLoggerBinder.SINGLETON from class org.slf4j.LoggerFactory 使用hbm2java时,使用hibernate-distribution- 3.3.1

Android Xposed框架出现java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation问题

第一次玩Xposed框架,按照多个demo的格式写了一个demo发现死活不进入 public abstract void handleLoadPackage(LoadPackageParam lpparam) throws Throwable; 方法,去/data/data/de.robv.android.xposed.installer/log/error.log查看,发现crash了 Loading modules from /data/app/com.example.xposed-1.ap

Xposed出现 java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation

Xposed出现 java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation的解决方法 第一次在Xposed的框架下编写模块,在官方给的tutorial上就出现了问题,也安装好了就是不出效果,查看exposed的日志后天报出一堆错误,开头是 java.lang.IllegalAccessError: Class ref in pre-verified cla

java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementatio

错误信息: java.lang.IllegalAccessError: Class ref inpre-verified class resolved to unexpected implementatio 发生场景:在动态加载APK.jar的时候 错误分析:这种一般是引用重复(也就是你现在的APK和你要加载的APK.Jar之间有重复的引用),像在我的项目中遇到的问题就是:被加载的apk选择的最低版本在4.0以下,需要引用 android.support.v7.app.ActionBarActi

java.lang.IllegalAccessError: tried to access method org.apache.commons.codec.digest.DigestUtils.getDigest(Ljava/lang/String;)Ljava/security/MessageDigest; from class com.xyb.mis.pay.jingdong.util.Sig

严重: Servlet.service() for servlet [springmvc] in context with path [/xyb-mis-web] threw exception [Handler processing failed; nested exception is java.lang.IllegalAccessError: tried to access method org.apache.commons.codec.digest.DigestUtils.getDige

【转】Xposed出现 java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation

Xposed出现 java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation的解决方法 第一次在Xposed的框架下编写模块,在官方给的tutorial上就出现了问题,也安装好了就是不出效果,查看exposed的日志后天报出一堆错误,开头是 java.lang.IllegalAccessError: Class ref in pre-verified cla

java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation getting while running test project?

转摘:http://stackoverflow.com/questions/11155340/java-lang-illegalaccesserror-class-ref-in-pre-verified-class-resolved-to-unexpe You are getting this error because of third party library reference added two times. You have added the application path in

Google Protobuf 使用 Java 版

一 . Protobuf 的入门 Protobuf 是一个灵活,高效,结构化的数据序列化框架, 相比于 XML 等传统的序列化工具,它更小,更快,更灵活,更简单. Protobuf 支持数据结构化一次可以到处使用.甚至跨语言使用.同通过代码生成工具可以自动生成不同语言版本的源代码,甚至可以在使用不同版本的数据结构中进行数据传递,实现数据结构的向前兼容. Google 的 protobuf 在业界非常流行,很多商业项目选择 protobuf 作为编码解码框架,这里我们一起回顾一下 Protobuf

google protobuf 简单实例

1.定义proto文件: User.proto package netty; option java_package="myprotobuf"; option java_outer_classname="UserProto"; message User{ required int32 ID=1; required string userName=2; required string Password=3; repeated string address=4; } 2