Return-Path: X-Original-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4F785E840 for ; Tue, 19 Feb 2013 16:39:55 +0000 (UTC) Received: (qmail 38888 invoked by uid 500); 19 Feb 2013 16:39:50 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 38552 invoked by uid 500); 19 Feb 2013 16:39:50 -0000 Mailing-List: contact user-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@hadoop.apache.org Delivered-To: mailing list user@hadoop.apache.org Received: (qmail 38543 invoked by uid 99); 19 Feb 2013 16:39:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 16:39:50 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.219.53] (HELO mail-oa0-f53.google.com) (209.85.219.53) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 16:39:44 +0000 Received: by mail-oa0-f53.google.com with SMTP id m1so6981128oag.40 for ; Tue, 19 Feb 2013 08:39:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type:x-gm-message-state; bh=ccP+HKGceltbT+l31hRPT1k8Bsv45Q05niAaZrFutX4=; b=RhltFOsuDpKzPDn2uqqUFBBc9BXPFGHKTWzEOE5W/hf/G9VU0ppaa3EO1Ngb96hfZS DcPJjMdWy2VQNeb6mHrkNI7+beKwwR3mAciBW5h+mK0rGtfZGyJgi0HBTikTS4FnMZKW 2A62pdvnTYzLOsZqXuVgAQnSDFxHbir6YXzoSMNLbOuCDGFoavk3nmNBvyYvr7BscrIX ZLZPG5f3ROQ6rd8TIZUWBMhY4cdSIdY+YFu1s3Gd5pWIZiq4UPxcJceqbdSP5P4XxQPV mfLQUsgKPtFAieTR+j3PFlzorAaOzJfqpE2DsXVXCBgm1/blICQbkoPIW8G333cH0/dt 8MEA== MIME-Version: 1.0 X-Received: by 10.60.3.10 with SMTP id 10mr8156744oey.61.1361291963957; Tue, 19 Feb 2013 08:39:23 -0800 (PST) Received: by 10.60.84.169 with HTTP; Tue, 19 Feb 2013 08:39:23 -0800 (PST) In-Reply-To: References: Date: Tue, 19 Feb 2013 20:39:23 +0400 Message-ID: Subject: Re: Trouble in running MapReduce application From: Fatih Haltas To: "user@hadoop.apache.org" Content-Type: multipart/alternative; boundary=e89a8f83ae1bf2809a04d6167b65 X-Gm-Message-State: ALoCoQn7WwyVA6uMAQnGJE515UMfjm48SKodH8mIf7CLndcf5j0PKE2PiTawixhm5F04i/xZSv1l X-Virus-Checked: Checked by ClamAV on apache.org --e89a8f83ae1bf2809a04d6167b65 Content-Type: text/plain; charset=ISO-8859-1 Thank you very much Harsh, Now, as I promised earlier I am much obliged to you. But, now I solved that problem by just changing the directories then again creating a jar file of org. but I am getting this error: 1.) What I got ------------------------------------------------------------------------------ [hadoop@ADUAE042-LAP-V flowclasses_18_02]$ hadoop jar flow19028pm.jar org.myorg.MapReduce /home/hadoop/project/hadoop-data/NetFlow 19_02.out Warning: $HADOOP_HOME is deprecated. Exception in thread "main" java.lang.UnsupportedClassVersionError: org/myorg/MapReduce : Unsupported major.minor version 51.0 at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:634) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:277) at java.net.URLClassLoader.access$000(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:212) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:266) at org.apache.hadoop.util.RunJar.main(RunJar.java:149) 2.) How I create my jar ------------------------------------------------------------------------------------- [hadoop@ADUAE042-LAP-V flowclasses_18_02]$ jar cvf flow19028pm.jar org added manifest adding: org/(in = 0) (out= 0)(stored 0%) adding: org/myorg/(in = 0) (out= 0)(stored 0%) adding: org/myorg/MapReduce$FlowPortReducer.class(in = 1661) (out= 690)(deflated 58%) adding: org/myorg/MapReduce.class(in = 1587) (out= 903)(deflated 43%) adding: org/myorg/MapReduce$FlowPortMapper.class(in = 1874) (out= 823)(deflated 56%) 3.) Content of my jar file --------------------------------------------------------------------------------------- [hadoop@ADUAE042-LAP-V flowclasses_18_02]$ jar tf flow19028pm.jar META-INF/ META-INF/MANIFEST.MF org/ org/myorg/ org/myorg/MapReduce$FlowPortReducer.class org/myorg/MapReduce.class org/myorg/MapReduce$FlowPortMapper.class ----------------------------------------------------------------------------------------- Thank you very much. On Tue, Feb 19, 2013 at 8:20 PM, Harsh J wrote: > Your point (4) explains the problem. The jar packed structure should > look like the below, and not how it is presently (one extra top level > dir is present): > > META-INF/ > META-INF/MANIFEST.MF > org/ > org/myorg/ > org/myorg/WordCount.class > org/myorg/WordCount$TokenizerMapper.class > org/myorg/WordCount$IntSumReducer.class > > On Tue, Feb 19, 2013 at 9:29 PM, Fatih Haltas > wrote: > > Hi everyone, > > > > I know this is the common mistake to not specify the class adress while > > trying to run a jar, however, > > although I specified, I am still getting the ClassNotFound exception. > > > > What may be the reason for it? I have been struggling for this problem > more > > than a 2 days. > > I just wrote different MapReduce application for some anlaysis. I got > this > > problem. > > > > To check, is there something wrong with my system, i tried to run > WordCount > > example. > > When I just run hadoop-examples wordcount, it is working fine. > > > > But when I add just "package org.myorg;" command at the beginning, it > > doesnot work. > > > > Here is what I have done so far > > ************************************************************************* > > 1. I just copied wordcount code from the apaches own examples source code > > and I just changed package decleration as "package org.myorg;" > > > ************************************************************************** > > 2. Then I tried to run that command: > > > ************************************************************************* > > "hadoop jar wordcount_19_02.jar org.myorg.WordCount > > /home/hadoop/project/hadoop-data/NetFlow 19_02_wordcount.output" > > ************************************************************************* > > 3. I got following error: > > > ************************************************************************** > > [hadoop@ADUAE042-LAP-V project]$ hadoop jar wordcount_19_02.jar > > org.myorg.WordCount /home/hadoop/project/hadoop-data/NetFlow > > 19_02_wordcount.output > > Warning: $HADOOP_HOME is deprecated. > > > > Exception in thread "main" java.lang.ClassNotFoundException: > > org.myorg.WordCount > > 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 java.lang.ClassLoader.loadClass(ClassLoader.java:266) > > at java.lang.Class.forName0(Native Method) > > at java.lang.Class.forName(Class.java:266) > > at org.apache.hadoop.util.RunJar.main(RunJar.java:149) > > > > > ************************************************************************** > > 4. This is the content of my .jar file: > > **************************************************** > > [hadoop@ADUAE042-LAP-V project]$ jar tf wordcount_19_02.jar > > META-INF/ > > META-INF/MANIFEST.MF > > wordcount_classes/ > > wordcount_classes/org/ > > wordcount_classes/org/myorg/ > > wordcount_classes/org/myorg/WordCount.class > > wordcount_classes/org/myorg/WordCount$TokenizerMapper.class > > wordcount_classes/org/myorg/WordCount$IntSumReducer.class > > ********************************************************** > > 5. This is the 'ls' output of my working directory: > > ********************************************************** > > [hadoop@ADUAE042-LAP-V project]$ ls > > flowclasses_18_02 flowclasses_18_02.jar hadoop-1.0.4 > hadoop-1.0.4.tar.gz > > hadoop-data MapReduce.java sample wordcount_19_02.jar > wordcount_classes > > WordCountClasses WordCount.java > > ************************************************************* > > So as you see, package decleration is fine but I am really helpless, I > > googled but they are all saying samething you should specify the package > > hierarchy of your main class. I did know it already I am specifying but > > doesn't work. > > > > I would be much obliged to anyone helped me > > > > Regards, > > > > -- > Harsh J > --e89a8f83ae1bf2809a04d6167b65 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thank you very much Harsh,

Now, a= s I promised earlier I am much obliged to you.=A0

But, now I solved that problem by just changing the directories= then again creating a jar file of org. but I am getting this error:

1.) What I got
-= ---------------------------------------------------------------------------= --
[hadoop@ADUAE042-LAP-V flowclasses_18_02]$ hadoop jar flo= w19028pm.jar org.myorg.MapReduce /home/hadoop/project/hadoop-data/NetFlow 1= 9_02.out
Warning: $HADOOP_HOME is deprecated.

Exceptio= n in thread "main" java.lang.UnsupportedClassVersionError: org/my= org/MapReduce : Unsupported major.minor version 51.0
=A0 =A0 =A0 = =A0 at java.lang.ClassLoader.defineClass1(Native Method)
=A0 =A0 =A0 =A0 at java.lang.ClassLoader.defineClass(ClassLoader.java:= 634)
=A0 =A0 =A0 =A0 at java.security.SecureClassLoader.defineCla= ss(SecureClassLoader.java:142)
=A0 =A0 =A0 =A0 at java.net.URLCla= ssLoader.defineClass(URLClassLoader.java:277)
=A0 =A0 =A0 =A0 at java.net.URLClassLoader.access$000(URLClassLoader.j= ava:73)
=A0 =A0 =A0 =A0 at java.net.URLClassLoader$1.run(URLClass= Loader.java:212)
=A0 =A0 =A0 =A0 at java.security.AccessControlle= r.doPrivileged(Native Method)
=A0 =A0 =A0 =A0 at java.net.URLClassLoader.findClass(URLClassLoader.ja= va:205)
=A0 =A0 =A0 =A0 at java.lang.ClassLoader.loadClass(ClassL= oader.java:321)
=A0 =A0 =A0 =A0 at java.lang.ClassLoader.loadClas= s(ClassLoader.java:266)
=A0 =A0 =A0 =A0 at java.lang.Class.forName0(Native Method)
= =A0 =A0 =A0 =A0 at java.lang.Class.forName(Class.java:266)
=A0 = =A0 =A0 =A0 at org.apache.hadoop.util.RunJar.main(RunJar.java:149)

2.) How I create my jar=A0
--------------------------------= -----------------------------------------------------
= [hadoop@ADUAE042-LAP-V flowclasses_18_02]$ jar cvf flow19028pm.jar org
added manifest
adding: org/(in =3D 0) (out=3D 0)(stored 0%)<= /div>
adding: org/myorg/(in =3D 0) (out=3D 0)(stored 0%)
addi= ng: org/myorg/MapReduce$FlowPortReducer.class(in =3D 1661) (out=3D 690)(def= lated 58%)
adding: org/myorg/MapReduce.class(in =3D 1587) (out=3D 903)(deflated 4= 3%)
adding: org/myorg/MapReduce$FlowPortMapper.class(in =3D 1874)= (out=3D 823)(deflated 56%)

3.) Conten= t of my jar file
----------------------------------------------------------------= -----------------------
[hadoop@ADUAE042-LAP-V flowcla= sses_18_02]$ jar tf flow19028pm.jar
META-INF/
META-INF/= MANIFEST.MF
org/
org/myorg/
org/myorg/MapReduce$FlowPortReduce= r.class
org/myorg/MapReduce.class
org/myorg/MapReduce$F= lowPortMapper.class
---------------------------------------------= --------------------------------------------


Thank you very much.


On = Tue, Feb 19, 2013 at 8:20 PM, Harsh J <harsh@cloudera.com> = wrote:
Your point (4) explains the problem. The jar= packed structure should
look like the below, and not how it is presently (one extra top level
dir is present):

META-INF/
META-INF/MANIFEST.MF
org/
org/myorg/
org/myorg/WordCount.class
org/myorg/WordCount$TokenizerMapper.class
org/myorg/WordCount$IntSumReducer.class

On Tue, Feb 19, 2013 at 9:29 PM, Fatih Haltas <fatih.haltas@nyu.edu> wrote:
> Hi everyone,
>
> I know this is the common mistake to not specify the class adress whil= e
> trying to run a jar, however,
> although I specified, I am still getting the ClassNotFound exception.<= br> >
> What may be the reason for it? I have been struggling for this problem= more
> than a 2 days.
> I just wrote different MapReduce application for some anlaysis. I got = this
> problem.
>
> To check, is there something wrong with my system, i tried to run Word= Count
> example.
> When I just run hadoop-examples wordcount, it is working fine.
>
> But when I add just "package org.myorg;" command at the begi= nning, it
> doesnot work.
>
> Here is what I have done so far
> **********************************************************************= ***
> 1. I just copied wordcount code from the apaches own examples source c= ode
> and I just changed package decleration as "package org.myorg;&quo= t;
> **********************************************************************= ****
> 2. Then I tried to run that command:
> =A0*******************************************************************= ******
> "hadoop jar wordcount_19_02.jar org.myorg.WordCount
> /home/hadoop/project/hadoop-data/NetFlow 19_02_wordcount.output"<= br> > **********************************************************************= ***
> 3. I got following error:
> **********************************************************************= ****
> [hadoop@ADUAE042-LAP-V project]$ hadoop jar wordcount_19_02.jar
> org.myorg.WordCount /home/hadoop/project/hadoop-data/NetFlow
> 19_02_wordcount.output
> Warning: $HADOOP_HOME is deprecated.
>
> Exception in thread "main" java.lang.ClassNotFoundException:=
> org.myorg.WordCount
> =A0 =A0 =A0 =A0 at java.net.URLClassLoader$1.run(URLClassLoader.java:2= 17)
> =A0 =A0 =A0 =A0 at java.security.AccessController.doPrivileged(Native = Method)
> =A0 =A0 =A0 =A0 at java.net.URLClassLoader.findClass(URLClassLoader.ja= va:205)
> =A0 =A0 =A0 =A0 at java.lang.ClassLoader.loadClass(ClassLoader.java:32= 1)
> =A0 =A0 =A0 =A0 at java.lang.ClassLoader.loadClass(ClassLoader.java:26= 6)
> =A0 =A0 =A0 =A0 at java.lang.Class.forName0(Native Method)
> =A0 =A0 =A0 =A0 at java.lang.Class.forName(Class.java:266)
> =A0 =A0 =A0 =A0 at org.apache.hadoop.util.RunJar.main(RunJar.java:149)=
>
> **********************************************************************= ****
> 4. This is the content of my .jar file:
> ****************************************************
> [hadoop@ADUAE042-LAP-V project]$ jar tf wordcount_19_02.jar
> META-INF/
> META-INF/MANIFEST.MF
> wordcount_classes/
> wordcount_classes/org/
> wordcount_classes/org/myorg/
> wordcount_classes/org/myorg/WordCount.class
> wordcount_classes/org/myorg/WordCount$TokenizerMapper.class
> wordcount_classes/org/myorg/WordCount$IntSumReducer.class
> **********************************************************
> 5. This is the 'ls' output of my working directory:
> **********************************************************
> [hadoop@ADUAE042-LAP-V project]$ ls
> flowclasses_18_02 =A0flowclasses_18_02.jar =A0hadoop-1.0.4 =A0hadoop-1= .0.4.tar.gz
> hadoop-data =A0MapReduce.java =A0sample =A0wordcount_19_02.jar =A0word= count_classes
> WordCountClasses =A0WordCount.java
> *************************************************************
> So as you see, package decleration is fine but I am really helpless, I=
> googled but they are all saying samething you should specify the packa= ge
> hierarchy of your main class. I did know it already I am specifying bu= t
> doesn't work.
>
> I would be much obliged to anyone helped me
>
> Regards,



--
Harsh J

--e89a8f83ae1bf2809a04d6167b65--