Results 1 to 12 of 12
  1. #1
    Ashwinub is offline Member
    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0

    Default Exception in thread "main" java.lang.NoClassDefFoundError

    Hello,

    Can anyone please help me fix this exception. I have been stuck on this for quite sometime now.
    I am using an application called DistMap, a bioinformatics application which is designed to work on hadoop. But I am getting this 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.j ava:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
    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.j ava:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
    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.j ava:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
    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.j ava:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 06)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launche r.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 47)
    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

    which java says

    /usr/java/jdk1.6.0_32/bin/java

    echo $CLASSPATH gives a blank line

    cat ~/.bash_profile says

    cat ~/.bash_profile
    # .bash_profile

    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi

    # User specific environment and startup programs

    PATH=$PATH:$HOME/bin

    export PATH

    Any suggestions?

    Thanks.

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    org/apache/hadoop/util/PlatformName is not on the classpath.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,776
    Rep Power
    5

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    so contact the people who designed this tool and ask them how to properly install it.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    Ashwinub is offline Member
    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    Quote Originally Posted by PhHein View Post
    org/apache/hadoop/util/PlatformName is not on the classpath.
    echo $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/hadoop-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/hadoop-0.20-mapreduce/hadoop-tools.jar:/usr/lib/hadoop-0.20-mapreduce/lib/

    I included all jars in my classpath. Still no luck..

  5. #5
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    You should see the jar when entering echo $CLASSPATH. DistMap uses those classes. When you start it, Java is searching in the classpath for needed libraries. HADOOP_CLASSPATH is irrelevant.
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,863
    Rep Power
    19

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    How do you run the app?
    Is it, in fact, an executable jar and you are simply not executing it correctly?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  7. #7
    Ashwinub is offline Member
    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    I have used the same jar files in CLASSPATH. Still I am getting the same error. Anything else I can try?

  8. #8
    Ashwinub is offline Member
    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    This is how I run the app.

    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 distmap_output/ --hadoop-home /usr/lib/hadoop-0.20-mapreduce/

    I am following the manual which is available at Manual - distmap - How to use DistMap is explained here - A toolkit for distributed short read mapping - Google Project Hosting

  9. #9
    Ashwinub is offline Member
    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    Quote Originally Posted by gimbal2 View Post
    so contact the people who designed this tool and ask them how to properly install it.
    It did work the first time. I mean one part of it worked fine and I got the expected output. I am not able to work further. Still I did send a mail to the developer and i started an issue in the issue tracking system. But no reply as of now.

  10. #10
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,863
    Rep Power
    19

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    Looks like that's some sort of launcher script/app.
    So it's all down to how they've designed their app to work.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  11. #11
    Ashwinub is offline Member
    Join Date
    Sep 2013
    Posts
    6
    Rep Power
    0

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    Yea I thought so. Still I was hopeful I will get some answers from here as it is a java exception.

  12. #12
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,776
    Rep Power
    5

    Default Re: Exception in thread "main" java.lang.NoClassDefFoundError

    After that first run files must have moved or been removed. Whatever that launcher is doing it is doing multiple things that are failing, its not just one failure.

    > Could not find the main class: org.apache.hadoop.util.PlatformName. Program will exit.
    > Could not find the main class: org.apache.hadoop.fs.FsShell. Program will exit.
    > Could not find the main class: org.apache.hadoop.util.PlatformName. Program will exit.
    > 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

    5 errors; the first are 4 individual Java programs that are failing to run because of missing classes. The last one looks like an error from the launcher itself. That last one gives me the gut feeling that it is the key to all problems, filesystem misery. It might be that the launcher on first run "installs" itself somewhere and runs from there, and from the second run onward fails to do so.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

Similar Threads

  1. Exception in thread "main" java.lang.NoClassDefFoundError:
    By madsovenielsen in forum New To Java
    Replies: 2
    Last Post: 10-04-2010, 05:41 PM
  2. Replies: 5
    Last Post: 06-02-2010, 01:05 PM
  3. Replies: 3
    Last Post: 06-01-2010, 03:01 PM
  4. Replies: 1
    Last Post: 04-02-2009, 09:50 PM
  5. Replies: 6
    Last Post: 08-18-2008, 06:44 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •