Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

NoClassDefFoundError: org/apache/hadoop/util/PlatformName

NoClassDefFoundError: org/apache/hadoop/util/PlatformName

Explorer

Hello,

I am new to hadoop infrastructure. I have setup one-node hadoop cluster using Cloudera manager 4.7.1. Now I am trying to use an application DistMap, a bioinformatics application which is designed to work on hadoop. I am getting the following error.

Exception in thread "main" java.lang.

NoClassDefFoundError: org/apache/hadoop/util/PlatformName
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
        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)
Could not find the main class: org.apache.hadoop.util.PlatformName.  Program will exit.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FsShell
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.fs.FsShell
        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)
Could not find the main class: org.apache.hadoop.fs.FsShell.  Program will exit.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/util/PlatformName
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.PlatformName
        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)
Could not find the main class: org.apache.hadoop.util.PlatformName.  Program will exit.
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/hadoop/fs/FsShell
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.fs.FsShell
        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)
Could not find the main class: org.apache.hadoop.fs.FsShell.  Program will exit.
Error could not create input directory /distmap_output_input folder on hdfs file system
 
$HADOOP_HOME /usr/lib/hadoop
$HADOOP_CLASSPATH
/usr/lib/hadoop-0.20-mapreduce/hadoop-ant-2.0.0-mr1-cdh4.4.0.jar:/usr/lib/hadoop‌ -0.20-mapreduce/hadoop-ant.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-examples-2.0‌ .0-mr1-cdh4.4.0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-examples.jar:/usr/lib/h‌ adoop-0.20-mapreduce/hadoop-core.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-core-2‌ .0.0-mr1-cdh4.4.0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-test-2.0.0-mr1-cdh4.4‌ .0.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-test.jar:/usr/lib/hadoop-0.20-mapreduce/hadoop-tools-2.0.0-mr1-cdh4.4.0.jar:/usr/lib/hado‌ op-0.20-mapreduce/hadoop-tools.jar:/usr/lib/hadoop-0.20-mapreduce/lib/*jar:/usr/lib/hadoop/hadoop-common.jar:/usr/lib/hadoop/hadoop-common-2.0.0-cdh4.4.0.jar

The last 2 jar files have those classes PlatformName and FsShell. Still its not working.

I am not really sure if this error has anything to do with cloudera hadoop. I don't know where I can ask for help regarding this. So I have posted here. Hoping to get some suggestions to fix this.

Thanks,
Ashwin
3 REPLIES 3

Re: NoClassDefFoundError: org/apache/hadoop/util/PlatformName

Master Collaborator

How are you running your client application?  Note that it should be run like the following:

 

hadoop jar <jar filename> <ClassName>

 

That is a first place to start.

Highlighted

Re: NoClassDefFoundError: org/apache/hadoop/util/PlatformName

Explorer

Hello Clint,

 

Thanks for getting back to me.

I am following DistMap Manual run the application.

 

This is how I am running DistMap

 

 DistMap_v1.0/distmap --reference-fasta datasets/WholeGenome/genome.fa --reference-index-archive datasets/indexed_genome/refarch.tgz --input "datasets/synthetic_sample1.fq.gz,datasets/synthetic_sample2.fq.gz" --mapper bwa --mapper-path bwa-0.5.8c/bwa --picard-mergesamfiles-jar picard-tools-1.99/MergeSamFiles.jar --picard-sortsam-jar picard-tools-1.99/SortSam.jar --mapper-args "-o 1 -n 0.01 -l 200 -e 12 -dd 12" --output-format sam --output /home/ashwin/distmap_output/ --hadoop-home /usr/lib/hadoop-0.20-mapreduce/

 

Cheers

Re: NoClassDefFoundError: org/apache/hadoop/util/PlatformName

Master Collaborator

@ash I have moved this thread to the MapReduce board in hopes someone here can assist you further.  This could very well be a configuration problem related to the MR framework, since it's a MR job you're trying to run.

 

Clint