The Hortonworks Community Connection is now live. A completely rebuilt Q&A forum, Knowledge Base, Code Hub and more, backed by the experts in the industry.

You will be redirected here in 10 seconds. If your are not redirected, click here to visit the new site.

The legacy Hortonworks Forum is now closed. You can view a read-only version of the former site by clicking here. The site will be taken offline on January 31,2016

HBase Forum

Bulkupload – : java.lang.NoClassDefFoundError: au/com/bytecode/opencsv/CSVParser

  • #51603
    Leslie
    Participant

    Hi All,
    I’m trying to perform a bulk upload using the example here: http://blog.cloudera.com/blog/2013/09/how-to-use-hbase-bulk-loading-and-why/
    I’ve created my own java program and have packaged it in a jar – bulkupload-1.0.jar. I’m doing the following:
    1. export HADOOP_CLASSPATH=/etc/hbase/conf:/usr/lib/hbase/lib/*:./hbase-server-0.96.2-hadoop2.jar:./opencsv-2.3.jar:./bulkupload-1.0.jar
    2. hadoop jar bulkupload-1.0.jar com.bulkupload.JobDriver

    I’m getting the following error:
    14/04/15 22:23:27 INFO mapreduce.Job: Task Id : attempt_1397617091118_0005_m_000001_2, Status : FAILED
    Error: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:131)
    at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:721)
    at org.apache.hadoop.mapred.MapTask.run(MapTask.java:339)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:162)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:396)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:157)
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:129)
    … 7 more
    Caused by: java.lang.NoClassDefFoundError: au/com/bytecode/opencsv/CSVParser
    at com.bulkupload.MyKVMapper.<init>(MyKVMapper.java:66)
    … 12 more
    Caused by: java.lang.ClassNotFoundException: au.com.bytecode.opencsv.CSVParser
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)

    Can anyone help me with this or point me in the right direction?

    Thanks in advance.

  • Author
    Replies
  • #52061
    Leslie
    Participant

    Ended up having to run these commands and it worked:
    export HADOOP_CLASSPATH=/etc/hbase/conf:/usr/lib/hbase/lib/*:./hbase-server-0.96.2-hadoop2.jar:./opencsv-2.3.jar:./hbase-protocol-0.96.2-hadoop2.jar:./bulkupload-1.0.jar

    hadoop jar bulkupload-1.0.jar com.bulkupload.JobDriver -libjars opencsv-2.3.jar,hbase-protocol-0.96.2-hadoop2.jar /temp/input/file.csv /temp/output_jackie

The forum ‘HBase’ is closed to new topics and replies.

Support from the Experts

A HDP Support Subscription connects you experts with deep experience running Apache Hadoop in production, at-scale on the most demanding workloads.

Enterprise Support »

Become HDP Certified

Real world training designed by the core architects of Hadoop. Scenario-based training courses are available in-classroom or online from anywhere in the world

Training »

Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.