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 BA491E24C for ; Tue, 19 Feb 2013 13:48:09 +0000 (UTC) Received: (qmail 60675 invoked by uid 500); 19 Feb 2013 13:48:04 -0000 Delivered-To: apmail-hadoop-hdfs-user-archive@hadoop.apache.org Received: (qmail 60304 invoked by uid 500); 19 Feb 2013 13:48:01 -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 60284 invoked by uid 99); 19 Feb 2013 13:48:01 -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 13:48:01 +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.50] (HELO mail-oa0-f50.google.com) (209.85.219.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2013 13:47:54 +0000 Received: by mail-oa0-f50.google.com with SMTP id l20so6975568oag.9 for ; Tue, 19 Feb 2013 05:47:34 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to :content-type:x-gm-message-state; bh=/AIWwehUbF+DYTYcp6InE08S33faT2XCY75H8P5NJH0=; b=IPoaPQE59XuEEkalIQ/C3xDWUzB0Y1uwnX8f8ESrsdf8hS39N5KQhfFxmrhiSVfN6d acMEmHavihnXFuKC70fzsuiu1xK1wla7HrEqWJ3PHXIbJ++5+BK3YjvMtpz42Cfxld2q QLenSJCVoUmFVzVBsmd3YhjsqfVoFlqBNlCJwOMZ/h6cr6D60uRdfJ0eZCkqScB+3b8Q s6C2TRQOGNdQFRNXtmLsMxulYp6ilJCoPJPuqnIKgsTk+oeRhugdpyHEuP6Np6WVddml APYmo10wqij5CVeF/Hu+PMFIUB21VTILcfFT3cAzjRCITI7A7xcxyv6YR4UL9d35+uel CPSw== MIME-Version: 1.0 X-Received: by 10.182.118.104 with SMTP id kl8mr7462773obb.54.1361281653979; Tue, 19 Feb 2013 05:47:33 -0800 (PST) Received: by 10.60.84.169 with HTTP; Tue, 19 Feb 2013 05:47:33 -0800 (PST) Date: Tue, 19 Feb 2013 17:47:33 +0400 Message-ID: Subject: ClassNotFoundException in Main From: Fatih Haltas To: "user@hadoop.apache.org" Content-Type: multipart/alternative; boundary=f46d044786b56cba5f04d614150a X-Gm-Message-State: ALoCoQnrhd9CzC5Ynp9LJVC3nGuftH41M7tI3wefQ7lwO6QZCaOXQLvnFPZR2O8YLtV04znkZd0Y X-Virus-Checked: Checked by ClamAV on apache.org --f46d044786b56cba5f04d614150a Content-Type: text/plain; charset=ISO-8859-1 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, --f46d044786b56cba5f04d614150a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi everyone,

I know this is the c= ommon mistake to not specify the class adress while trying to run a jar, ho= wever,
although I specified, I am still getting the ClassNo= tFound exception.

What may be the reason for it? I have been = struggling for this problem more than a 2 days.=A0
I just w= rote 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 h= adoop-examples wordcount, it is working fine.=A0

But when I add just "package org.myorg;" command at th= e beginning, it doesnot work.

Here is = what I have done so far
***********************************= **************************************
1. I just copied wordcount code from the apaches own examples so= urce code and I just changed package decleration as "package org.myorg= ;"
***************************************************= ***********************
2. Then I tried to run that command:
=A0********= *****************************************************************
"hadoop jar wordcount_19_02.jar org.myorg.WordCount /home/hadoo= p/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_0= 2_wordcount.output
Warning: $HADOOP_HOME is deprecated.

Exception in thread "main" java.lang.ClassNot= FoundException: org.myorg.WordCount
=A0 =A0 =A0 =A0 at java.net.U= RLClassLoader$1.run(URLClassLoader.java:217)
=A0 =A0 =A0 =A0 at j= ava.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(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)

**************************************************************************<= /div>
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/myor= g/WordCount$IntSumReducer.class
*********************************= *************************
5. This is the 'ls' output of my working dir= ectory:
***************************************************= *******
[hadoop@ADUAE042-LAP-V project]$ ls
flowclasses_18_02 =A0flowclasses_18_02.jar =A0hadoop-1.0.4 =A0hadoop-1.0.4.= tar.gz =A0hadoop-data =A0MapReduce.java =A0sample =A0wordcount_19_02.jar = =A0wordcount_classes =A0WordCountClasses =A0WordCount.java
******= *******************************************************
So as you see, package decleration is fine but I am really helpl= ess, I googled but they are all saying samething you should specify the pac= kage hierarchy of your main class. I did know it already I am specifying bu= t doesn't work.=A0

I would be much obliged to anyone helped me=

Regards,


--f46d044786b56cba5f04d614150a--