Hadoop Pig java lang NoClassDefFoundError org apache hadoop hbase filter Filter

0 votes

This is my Pig-script:

register /usr/lib/zookeeper/zookeeper-3.4.3-cdh4.1.2.jar
register /usr/lib/hbase/hbase-0.92.1-cdh4.1.2-security.jar
register /usr/lib/hbase/lib/guava-11.0.2.jar

raw_data = LOAD 'input.csv' USING PigStorage( ',' ) AS (
listing_id: chararray,
fname: chararray,
lname: chararray );

STORE raw_data INTO 'hbase://sample_names' USING org.apache.pig.backend.hadoop.hbase.HBaseStorage ('info:fname info:lname');

Now, I run this command:

pig -x local hbase_sample.pig

I get following error message

Pig Stack Trace
---------------
ERROR 2998: Unhandled internal error. org/apache/hadoop/hbase/filter/Filter

java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/filter/Filter
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:478)
    at org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:508)
    at org.apache.pig.parser.LogicalPlanBuilder.validateFuncSpec(LogicalPlanBuilder.java:791)
    at org.apache.pig.parser.LogicalPlanBuilder.buildFuncSpec(LogicalPlanBuilder.java:780)
    at org.apache.pig.parser.LogicalPlanGenerator.func_clause(LogicalPlanGenerator.java:4583)
    at org.apache.pig.parser.LogicalPlanGenerator.store_clause(LogicalPlanGenerator.java:6225)
    at org.apache.pig.parser.LogicalPlanGenerator.op_clause(LogicalPlanGenerator.java:1335)
    at org.apache.pig.parser.LogicalPlanGenerator.general_statement(LogicalPlanGenerator.java:789)
    at org.apache.pig.parser.LogicalPlanGenerator.statement(LogicalPlanGenerator.java:507)
    at org.apache.pig.parser.LogicalPlanGenerator.query(LogicalPlanGenerator.java:382)
    at org.apache.pig.parser.QueryParserDriver.parse(QueryParserDriver.java:175)
    at org.apache.pig.PigServer$Graph.parseQuery(PigServer.java:1594)
    at org.apache.pig.PigServer$Graph.registerQuery(PigServer.java:1545)
    at org.apache.pig.PigServer.registerQuery(PigServer.java:545)
    at org.apache.pig.tools.grunt.GruntParser.processPig(GruntParser.java:970)
    at org.apache.pig.tools.pigscript.parser.PigScriptParser.parse(PigScriptParser.java:386)
    at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:189)
    at org.apache.pig.tools.grunt.GruntParser.parseStopOnError(GruntParser.java:165)
    at org.apache.pig.tools.grunt.Grunt.exec(Grunt.java:84)
    at org.apache.pig.Main.run(Main.java:430)
    at org.apache.pig.Main.main(Main.java:111)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.hadoop.util.RunJar.main(RunJar.java:208)
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.filter.Filter
    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)

How to solve this error? TIA

Nov 16, 2018 in Big Data Hadoop by slayer
• 29,370 points
2,037 views

1 answer to this question.

0 votes

This seems like a problem with the PATH. Please make sure you have set all the paths right. Especially the PIG_CLASSPATH

export PIG_CLASSPATH=”`hbase classpath`:$PIG_CLASSPATH”
answered Nov 16, 2018 by Omkar
• 69,220 points

Related Questions In Big Data Hadoop

0 votes
1 answer
0 votes
1 answer

Hadoop Java Error: java.lang.NoClassDefFoundError: WordCount (wrong name: org/myorg/WordCount)

Hey, try this code import java.io.IOException; import java.util.Iterator; import java.util.StringTokenizer; import ...READ MORE

answered Sep 19, 2018 in Big Data Hadoop by slayer
• 29,370 points
6,168 views
0 votes
1 answer

PIG - Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected

Yes, it is a compatibility issue. in Hadoop ...READ MORE

answered Oct 10, 2018 in Big Data Hadoop by Omkar
• 69,220 points
1,088 views
0 votes
1 answer

What do we exactly mean by “Hadoop” – the definition of Hadoop?

The official definition of Apache Hadoop given ...READ MORE

answered Mar 16, 2018 in Big Data Hadoop by Shubham
1,856 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
11,007 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,520 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,698 views
0 votes
1 answer

Spark : java.lang.ClassNotFoundException: org.apache.hadoop.fs.FSDataInputStream

Create a spark-env.cmd file looking like this @echo off set ...READ MORE

answered Jan 2, 2019 in Big Data Hadoop by Omkar
• 69,220 points
11,960 views
0 votes
1 answer

java.lang.NoSuchMethodError: org.apache.hadoop.fs.FSOutputSummer

Seems like you have not set the ...READ MORE

answered Jan 29, 2019 in Big Data Hadoop by Omkar
• 69,220 points
3,505 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