title: class com.google.protobuf.HBaseZeroCopyByteString cannot access its superclass com.google.protobuf.LiteralByteString
body: <p>I am getting the below error when running the spark application:</p>
  
  <pre><code>16/01/08 15:25:48 INFO SchemaMetadata: Entering synchronized block to initiate
  16/01/08 15:25:48 INFO SchemaMetadata: Initializing SchemaMetadata
  16/01/08 15:25:48 INFO SchemaMetadata: Schema initialized from database
  16/01/08 15:25:48 INFO SchemaMetadata: Registering for notifications
  16/01/08 15:25:49 WARN HConnectionManager$HConnectionImplementation: Encountered problems when prefetch hbase:meta table:
  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.HTable.getRowOrBefore(HTable.java:714)
  at org.apache.hadoop.hbase.client.MetaScanner.metaScan(MetaScanner.java:144)
  at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.prefetchRegionCache(HConnectionManager.java:1159)
  at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegionInMeta(HConnectionManager.java:1223)
  at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:1111)
  at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.locateRegion(HConnectionManager.java:1068)
  at org.apache.hadoop.hbase.client.AsyncProcess.findDestLocation(AsyncProcess.java:361)
  at org.apache.hadoop.hbase.client.AsyncProcess.submit(AsyncProcess.java:306)
  at org.apache.hadoop.hbase.client.HTable.backgroundFlushCommits(HTable.java:964)
  at org.apache.hadoop.hbase.client.HTable.flushCommits(HTable.java:1252)
  at org.apache.hadoop.hbase.client.HTable.put(HTable.java:924)
  
  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.buildGetRowOrBeforeRequest(RequestConverter.java:133)
  at org.apache.hadoop.hbase.protobuf.ProtobufUtil.getRowOrBefore(ProtobufUtil.java:1497)
  at org.apache.hadoop.hbase.client.HTable$2.call(HTable.java:710)
  at org.apache.hadoop.hbase.client.HTable$2.call(HTable.java:708)
  at org.apache.hadoop.hbase.client.RpcRetryingCaller.callWithRetries(RpcRetryingCaller.java:114)
  ... 31 more
  </code></pre>
  
  <p>The problem here i found is the class loader is loading the LiteralByteString class from Spark assembly jar earlier in the JVM and then loading the HBaseZeroCopyByteString class from the user jar. That's why it is creating the problem.</p>
  
  <p>Spark provide one property to load the user jar first in JVM that is <code>spark.executor.userClassPathFirst</code>, But unfortunately not getting luck in this as well.</p>
  
  <p>Please suggest solution if anyone has encountered and resolved this problem.</p>