You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-user@hadoop.apache.org by raghavendhra rahul <ra...@gmail.com> on 2012/01/09 09:23:36 UTC

Cannot start yarn daemons

Hi,
  I am trying to install hadoop 0.23.1 SNAPSHOT. while starting yarn
daemons.sh it shows the following error
Exception in thread "main" java.lang.NoClassDefFoundError:
org/apache/hadoop/conf/Configuration
Caused by: java.lang.ClassNotFoundException:
org.apache.hadoop.conf.Configuration
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
Could not find the main class:
org.apache.hadoop.yarn.server.resourcemanager.ResourceManager. Program will
exit.

Re: Cannot start yarn daemons

Posted by Ravi Prakash <ra...@gmail.com>.
Hi,

Clearly the jar file containing the class
"org/apache/hadoop/conf/Configuration" is not available on the CLASSPATH.
Did you build hadoop properly? The way I would usually check this is:
1. I have a shell script findclass
#!/bin/sh
LOOK_FOR=$1

if [ -z $LOOK_FOR ]; then
        echo -e "Usage: findclass <classname>\n Will find . -name *.jar and
jar tvf them"
fi

for i in `find . -name "*.jar"`
do
  echo "Looking in $i ..."
  jar tvf $i | grep $LOOK_FOR > /dev/null
  if [ $? == 0 ]
  then
    echo "==> Found \"$LOOK_FOR\" in $i"
  fi
done

If you run findclass org/apache/hadoop/conf/Configuration, it will tell you
the list of jars in subdirectories which contain that class.

2. Check that atleast one of the jars listed in the CLASSPATH printed out
when you run the yarn-daemon.sh is one which contains the above class. This
in your case is hadoop-common*.jar (e.g. hadoop-common-0.23.1-SNAPSHOT.jar)

HTH
Ravi


On Mon, Jan 9, 2012 at 2:23 AM, raghavendhra rahul <
raghavendhrarahul@gmail.com> wrote:

> Hi,
>   I am trying to install hadoop 0.23.1 SNAPSHOT. while starting yarn
> daemons.sh it shows the following error
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/hadoop/conf/Configuration
> Caused by: java.lang.ClassNotFoundException:
> org.apache.hadoop.conf.Configuration
>     at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
>     at java.security.AccessController.doPrivileged(Native Method)
>     at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
>     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
>     at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
> Could not find the main class:
> org.apache.hadoop.yarn.server.resourcemanager.ResourceManager. Program will
> exit.
>