Error while creating avrodatafile

0 votes

I am trying to create a avrodatafile using the below command.

sqoop import \
--connect jdbc:mysql://localhost/test \
--username root \
--table dept \
--as-avrodatafile \
--target-dir /user/edureka/dept

I am getting the below error. can you please help to resolve this issue.

18/01/19 12:28:30 INFO mapreduce.Job: The url to track the job: http://localhost:8088/proxy/application_1542433891662_0009/
18/01/19 12:28:30 INFO mapreduce.Job: Running job: job_1542433891662_0009
18/01/19 12:28:36 INFO mapreduce.Job: Job job_1542433891662_0009 running in uber mode : false
18/01/19 12:28:36 INFO mapreduce.Job: map 0% reduce 0%
18/01/19 12:28:47 INFO mapreduce.Job: Task Id : attempt_1542433891662_0009_m_000000_0, 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:415)
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:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.apache.hadoop.util.ReflectionUtils.newInstance(ReflectionUtils.java:129)
... 7 more
Caused by: java.lang.NoClassDefFoundError: org/apache/avro/mapred/AvroWrapper
at org.apache.sqoop.mapreduce.AvroImportMapper.(AvroImportMapper.java:51)
... 12 more
Caused by: java.lang.ClassNotFoundException: org.apache.avro.mapred.AvroWrapper
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 sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
Jan 22, 2019 in Big Data Hadoop by Yazim
701 views

1 answer to this question.

0 votes

The error you are getting is AvroWrapper class not found. You have to download the Avro jar. You can get it from the URL below:

http://central.maven.org/maven2/org/apache/avro/avro-mapred/1.7.7/avro-mapred-1.7.7.jar

Now, place the above-downloaded jar into the Sqoop lib folder,

cp /home/user/Downloads/avro-mapred-1.7.7.jar /usr/lib/sqoop-1.4.4/lib/
answered Jan 22, 2019 by Omkar
• 69,230 points

Related Questions In Big Data Hadoop

+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer

Getting error while building Hadoop core jar using ant.

I think you are missing libtool library. ...READ MORE

answered Apr 18, 2018 in Big Data Hadoop by coldcode
• 2,090 points
962 views
0 votes
1 answer

Error while copying the file from local to HDFS

Well, the reason you are getting such ...READ MORE

answered May 3, 2018 in Big Data Hadoop by Ashish
• 2,650 points
3,935 views
+1 vote
1 answer

Hadoop Mapreduce word count Program

Firstly you need to understand the concept ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
10,930 views
0 votes
1 answer

hadoop.mapred vs hadoop.mapreduce?

org.apache.hadoop.mapred is the Old API  org.apache.hadoop.mapreduce is the ...READ MORE

answered Mar 16, 2018 in Data Analytics by nitinrawat895
• 11,380 points
2,457 views
+2 votes
11 answers

hadoop fs -put command?

Hi, You can create one directory in HDFS ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by nitinrawat895
• 11,380 points
108,345 views
–1 vote
1 answer

Hadoop dfs -ls command?

In your case there is no difference ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by kurt_cobain
• 9,390 points
4,550 views
–1 vote
1 answer

Error while creating Hive Database table

In your error, it says that the ...READ MORE

answered Jan 8, 2019 in Big Data Hadoop by Omkar
• 69,230 points
2,883 views
+4 votes
3 answers

Unable to find file error- while Streaming Hadoop

Is python installed running on the slaves that ...READ MORE

answered Oct 16, 2018 in Big Data Hadoop by Vinith
4,168 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP