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

This topic contains 1 reply, has 1 voice, and was last updated by  Leslie 8 months ago.

  • Creator
    Topic
  • #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.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.

  • 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

    Collapse
Viewing 1 replies (of 1 total)