Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
MapReduce >> mail # dev >> Can't find main class when run ResourceManager or NodeManager


Copy link to this message
-
Re: Can't find main class when run ResourceManager or NodeManager
Hoayuan,

RunJar is in the hadoop-common-0.23.0-SNAPSHOT.jar. Do a 'hadoop classpath'
and check if the jar file is there in the classpath location.

Similarly, running 'yarn classpath' will provide the classpath for running
the yarn daemons (RM, NM and HS).

Thanks,
Praveen

On Fri, Aug 12, 2011 at 5:18 AM, Haoyuan Li <[EMAIL PROTECTED]> wrote:

> Hi Mahadev,
>
> This works for me. Thank you.
>
> However, another issue came to me when I tried to run an example.
>
> Here
>
> http://svn.apache.org/repos/asf/hadoop/common/branches/MR-279/mapreduce/INSTALL
> ,
> it says:
>
> $HADOOP_COMMON_HOME/bin/hadoop jar
> $HADOOP_MAPRED_HOME/build/hadoop-mapred-examples-0.22.0-SNAPSHOT.jar
> randomwriter -Dmapreduce.job.user.name=$USER
> -Dmapreduce.clientfactory.class.name
> =org.apache.hadoop.mapred.YarnClientFactory
> -Dmapreduce.randomwriter.bytespermap=10000 -Ddfs.blocksize=536870912
> -Ddfs.block.size=536870912 -libjars
>
> $HADOOP_YARN_INSTALL/hadoop-mapreduce-1.0-SNAPSHOT/modules/hadoop-mapreduce-client-jobclient-1.0-SNAPSHOT.jar
> output
>
> However, there is no /bin folder in $HADOOP_COMMON_HOME. I found
> /bin/hadoop
> in $HADOOP_COMMON_HOME/src/main/bin/hadoop. When I executed the command:
>
> ./hadoop-common/src/main/bin/hadoop jar
>
> /home/haoyuan/hadoop/trunk/mapreduce/build/hadoop-mapred-examples-0.23.0-SNAPSHOT.jar
> randomwriter -Dmapreduce.job.user.name=haoyuan -
> Dmapreduce.clientfactory.class.name
> =org.apache.hadoop.mapred.YarnClientFactory
> -Dmapreduce.randomwriter.bytespermap=10000 -Ddfs.blocksize=536870912
> -Ddfs.block.size=536870912 -libjars
>
> /home/haoyuan/hadoop/trunk/hadoop-mapreduce-1.0-SNAPSHOT/modules/hadoop-mapreduce-client-jobclient-1.0-SNAPSHOT.jar
> output
>
> I got another exception:
> ==========================================> haoyuan@hya:~/hadoop/trunk$ ./hadoop-common/src/main/bin/hadoop jar
>
> /home/haoyuan/hadoop/trunk/mapreduce/build/hadoop-mapred-examples-0.23.0-SNAPSHOT.jar
> randomwriter -Dmapreduce.job.user.name=haoyuan -
> Dmapreduce.clientfactory.class.name
> =org.apache.hadoop.mapred.YarnClientFactory
> -Dmapreduce.randomwriter.bytespermap=10000 -Ddfs.blocksize=536870912
> -Ddfs.block.size=536870912 -libjars
>
> /home/haoyuan/hadoop/trunk/hadoop-mapreduce-1.0-SNAPSHOT/modules/hadoop-mapreduce-client-jobclient-1.0-SNAPSHOT.jar
> output
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/hadoop/util/RunJar
> Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.RunJar
> 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.RunJar.  Program will
> exit.
> ==========================================>
> Any clue?
>
> Thank you.
>
> Best,
>
> Haoyuan
>
>
>
>
>
>
>
> On Thu, Aug 11, 2011 at 3:47 PM, Mahadev Konar <[EMAIL PROTECTED]
> >wrote:
>
> > Haoyuan,
> >  Thats an issue with having avro 1.3.2 jar in the classpath. Please
> > see if you have that version of 1.3.2 jar in the classpath and remove
> > it. We use 1.4 avro jar which isnt compatible with 1.3.2.
> >
> > hope that helps!
> > mahadev
> >
> > On Thu, Aug 11, 2011 at 3:36 PM, Haoyuan Li <[EMAIL PROTECTED]>
> wrote:
> > > I downloaded the latest version: r1156719. and then redid from the
> > scratch.
> > > Now, the nodemanager and run well. However, I got into the same state
> as
> > > Matei when I tried to run ResourceManager.  Any help will be
> appreciated.
> > > Best,
> > > Haoyuan
> > > The followings are output.
> > > ============ The output from .out log file ================> > > Exception in thread "main" java.lang.IllegalStateException: For this
> > > operation, current State must be STARTED instead of INITED