Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

Unable to execute HBase MapReduce using hadoop jar

New Contributor

We have a code to which ingests data from one hbase table to another hbase table using mapreduce using hadoop jar in HDP. Now, we are migrating to CDH 7.1.5. Here when I'm trying to execute the same HBase Mapreduce program using hadoop jar, the code is failing with below error. Can someone help how to resolve this?


Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/hbase/HBaseConfiguration
at com.hbase.HbaseTableIngestion.main(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(
at sun.reflect.DelegatingMethodAccessorImpl.invoke(
at java.lang.reflect.Method.invoke(
at org.apache.hadoop.util.RunJar.main(
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.hbase.HBaseConfiguration
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(

I guess it's not picking up the hbase related jars. But, I'm not sure how to fix this. It would be really helpful if someone can help.


Master Collaborator

Please share us the command you run the jar.

Try to add the classpath before hadoop jar like this:

HADOOP_CLASSPATH=/etc/hbase/conf:$(hbase mapredcp) hadoop jar /path/to/jar 

If it solves your problem please accept the answer and click thumbs up.