<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Can't get rid of NoClassDefFoundError: org/apache/hadoop/hive/serde2/columnar/BytesRefArrayWritable in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/28063#M6133</link>
    <description>&lt;P&gt;I'm using &amp;nbsp;Java mapreduce job to write data to a directory which will be interpreted as a Hive table in RCFile format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to do this, I need to include&amp;nbsp;org.apache.hadoop.hive.serde2.columnar.BytesRefArrayWritable object,&lt;/P&gt;&lt;P&gt;which can be found in&amp;nbsp;hive-serde-0.13.1-cdh5.3.3.jar. So far, so good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've included the jar in my command line like this:&lt;/P&gt;&lt;P&gt;/usr/bin/hadoop jar /path/lib/awesome-mapred-0.9.6.jar com.awesome.HiveLoadController -libjars /path/lib/postgresql-8.4-702.jdbc4.jar,/path/lib/hive-serde-0.13.1-cdh5.3.3.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know for certain that it is loading the postgres library because it prints correctly retrieved information before it throws the error.&lt;/P&gt;&lt;P&gt;I know that it is grabbing and transferring that jar file because it throws a fit if I move it from the /path/lib directory.&lt;/P&gt;&lt;P&gt;I know that the object exists in the jar because I've unpacked it and looked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something in the rest of the lib path that might be interfering with it finding that object in the jar?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Sep 2022 09:30:18 GMT</pubDate>
    <dc:creator>Mythobeast</dc:creator>
    <dc:date>2022-09-16T09:30:18Z</dc:date>
    <item>
      <title>Can't get rid of NoClassDefFoundError: org/apache/hadoop/hive/serde2/columnar/BytesRefArrayWritable</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/28063#M6133</link>
      <description>&lt;P&gt;I'm using &amp;nbsp;Java mapreduce job to write data to a directory which will be interpreted as a Hive table in RCFile format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In order to do this, I need to include&amp;nbsp;org.apache.hadoop.hive.serde2.columnar.BytesRefArrayWritable object,&lt;/P&gt;&lt;P&gt;which can be found in&amp;nbsp;hive-serde-0.13.1-cdh5.3.3.jar. So far, so good.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've included the jar in my command line like this:&lt;/P&gt;&lt;P&gt;/usr/bin/hadoop jar /path/lib/awesome-mapred-0.9.6.jar com.awesome.HiveLoadController -libjars /path/lib/postgresql-8.4-702.jdbc4.jar,/path/lib/hive-serde-0.13.1-cdh5.3.3.jar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know for certain that it is loading the postgres library because it prints correctly retrieved information before it throws the error.&lt;/P&gt;&lt;P&gt;I know that it is grabbing and transferring that jar file because it throws a fit if I move it from the /path/lib directory.&lt;/P&gt;&lt;P&gt;I know that the object exists in the jar because I've unpacked it and looked.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something in the rest of the lib path that might be interfering with it finding that object in the jar?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 09:30:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/28063#M6133</guid>
      <dc:creator>Mythobeast</dc:creator>
      <dc:date>2022-09-16T09:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rid of NoClassDefFoundError: org/apache/hadoop/hive/serde2/columnar/BytesRefArrayWrita</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/28912#M6134</link>
      <description>What is the full stack trace? That'd be necessary to tell where the failure point lies.&lt;BR /&gt;&lt;BR /&gt;If it fails at the driver/client end, you will likely also need to add the jar to HADOOP_CLASSPATH env-var before the command invocation.&lt;BR /&gt;&lt;BR /&gt;If it fails at the MR task end, then you'll need to make sure your distributed-cache configs works (by checking job config xml to search your jar inside it)</description>
      <pubDate>Wed, 24 Jun 2015 21:39:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/28912#M6134</guid>
      <dc:creator>Harsh J</dc:creator>
      <dc:date>2015-06-24T21:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rid of NoClassDefFoundError: org/apache/hadoop/hive/serde2/columnar/BytesRefArrayWrita</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/29298#M6135</link>
      <description>&lt;P&gt;This error was called during the execution of the job controller within the MapReduce job. Here's a similar one with the same root problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="courier new,courier"&gt;Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hive/ql/io/orc/OrcNewOutputFormat
	at com.who.bgt.logloader.schema.OrcFileLoader.run(OrcFileLoader.java:94)
	at org.apache.hadoop.util.ToolRunner.run(ToolRunner.java:70)
	at com.who.bgt.logloader.schema.OrcFileLoader.main(OrcFileLoader.java:45)
	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.main(RunJar.java:212)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hive.ql.io.orc.OrcNewOutputFormat
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	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)
	... 8 more&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The specific line it is complaining about is here:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;job&lt;/SPAN&gt;.setOutputFormatClass(OrcNewOutputFormat.&lt;SPAN class="s2"&gt;class&lt;/SPAN&gt;);&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;The obvious problem is that it's failing to find the OrcNewOutputFormat class definition, which is in&amp;nbsp;hive-exec-0.13.1-cdh5.3.5.jar&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;I pushed the jar to hdfs://lib/hive-exec..., and within my main function, I call the following before I run the job:&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;		DistributedCache.addFileToClassPath(new Path("/lib/hive-exec-0.13.1-cdh5.3.5.jar"), lConfig);&lt;/PRE&gt;&lt;P class="p1"&gt;Can you be more explicit on how I go about making sure my distributed-cache configs work?&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;Optimally, I shouldn't have to stuff this one in the distributed cache since it sits in&amp;nbsp;/opt/cloudera/parcels/CDH-5.3.5-1.cdh5.3.5.p0.4/jars/hive-exec-0.13.1-cdh5.3.5.jar on all of my slave nodes, but I also can't figure out how to tell MapReduce to look there.&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jul 2015 22:40:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/29298#M6135</guid>
      <dc:creator>Mythobeast</dc:creator>
      <dc:date>2015-07-06T22:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rid of NoClassDefFoundError: org/apache/hadoop/hive/serde2/columnar/BytesRefArrayWrita</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/29312#M6136</link>
      <description>&lt;P&gt;Thank you for the additional details!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;FONT face="courier new,courier"&gt;at org.apache.hadoop.util.RunJar.main(RunJar.java:212)&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;This indicates a problem in the driver-end, or as you say 'during the execution of the job controller'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is that even if you do add something to the MR distributed cache classpath, your executor class also&amp;nbsp;references the same class. The act of adding a jar to the distributed task's classpath does not also add it to the local one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's how you can ensure that, if you use 'hadoop jar' to execute your job:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;~&amp;gt; export HADOOP_CLASSPATH=/opt/cloudera/parcels/CDH/lib/hive/lib/hive-exec.jar
~&amp;gt; hadoop jar your-app.jar your.main.Class [arguments]&lt;/PRE&gt;&lt;P&gt;This will add it also to your local JVM classpath, while&amp;nbsp;your code will further add it onto the remote execution classpaths.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="lucida sans unicode,lucida sans"&gt;&lt;SPAN&gt;&amp;gt; Optimally, I shouldn't have to stuff this one in the distributed cache since it sits in&amp;nbsp;/opt/cloudera/parcels/CDH-5.3.5-1.cdh5.3.5.p0.4&lt;/SPAN&gt;&lt;SPAN&gt;/jars/hive-exec-0.13.1-cdh5.3.5.jar on all of my slave nodes, but I also can't figure out how to tell MapReduce to look there.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;MR remote execution classpath is governed by the classpath entry defined in the mapred-site.xml and yarn-site.xml, and the additonal elements you add to the DistributedCache. They do not use the entire /opt/cloudera/parcels/CDH/jars/* path - this is so for isolation and flexibility purposes, as that area may carry multiple versions of the same dependencies, etc.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does this help?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jul 2015 05:15:34 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/29312#M6136</guid>
      <dc:creator>Harsh J</dc:creator>
      <dc:date>2015-07-07T05:15:34Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rid of NoClassDefFoundError: org/apache/hadoop/hive/serde2/columnar/BytesRefArrayWrita</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/59700#M6137</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm facing a similar issue with&amp;nbsp;RCFileInputFormat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im executing a simple code to read from a RCFile in mapper (usind RCFileInputFormat) and doing an aggregation on reducer side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A able to compile the code. But, while running facing&amp;nbsp;ClassNotFoundException for&amp;nbsp;Class org.apache.hadoop.hive.ql.io.RCFileInputFormat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried adding the jar in hadoop classpath but no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The below is the StackTrace.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;gt;&amp;nbsp;hadoop jar MRJobRCFile.jar MRJobRCFile /apps/hive/warehouse/7360_0609_rx/day=06-09-2017/hour=13/quarter=2/ /test_9&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class org.apache.hadoop.hive.ql.io.RCFileInputFormat not found&lt;BR /&gt;at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1649)&lt;BR /&gt;at org.apache.hadoop.mapred.JobConf.getInputFormat(JobConf.java:620)&lt;BR /&gt;at org.apache.hadoop.mapred.MapTask.runOldMapper(MapTask.java:394)&lt;BR /&gt;at org.apache.hadoop.mapred.MapTask.run(MapTask.java:332)&lt;BR /&gt;at org.apache.hadoop.mapred.Child$4.run(Child.java:268)&lt;BR /&gt;at java.security.AccessController.doPrivileged(Native Method)&lt;BR /&gt;at javax.security.auth.Subject.doAs(Subject.java:415)&lt;BR /&gt;at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1408)&lt;BR /&gt;at org.apache.hadoop.mapred.Child.main(Child.java:262)&lt;BR /&gt;Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class org.apache.hadoop.hive.ql.io.RCFileInputFormat not found&lt;BR /&gt;at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:1617)&lt;BR /&gt;at org.apache.hadoop.conf.Configuration.getClass(Configuration.java&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I investigate from jobconf.xml . If so, what do i need to check ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 06:24:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/59700#M6137</guid>
      <dc:creator>Raghavi</dc:creator>
      <dc:date>2017-09-08T06:24:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can't get rid of NoClassDefFoundError: org/apache/hadoop/hive/serde2/columnar/BytesRefArrayWrita</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/59705#M6138</link>
      <description>&lt;P&gt;I was able to make the job run by adding hive-exec jar in&amp;nbsp;HADOOP_CLASSPATH as well as adding the jar in distributed cache.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you throw some light as to why do we need to export the jar to classpath and also add in distributed cache.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Sep 2017 08:17:32 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Can-t-get-rid-of-NoClassDefFoundError-org-apache-hadoop-hive/m-p/59705#M6138</guid>
      <dc:creator>Raghavi</dc:creator>
      <dc:date>2017-09-08T08:17:32Z</dc:date>
    </item>
  </channel>
</rss>

