RE: ClassNotFoundException while running quick start guide on Windows.

2011-06-22 Thread Sandy Pratt
Hi Drew,

I don't know if this is actually the issue or not, but the output below makes 
me think you might be passing Cygwin pathes into the java.exe launcher.  If 
that's the case, it won't work.  java.exe is pure Windows and doesn't know 
about '/cygdrive/c' for example (it also expects the path separator to be 
semicolon rather than colon).  Every once in a while when I try to use java.exe 
from the Cygwin CLI on my Windows box, I get bitten by this.

Sandy

 -Original Message-
 From: Drew Gross [mailto:drew.a.gr...@gmail.com]
 Sent: Tuesday, June 21, 2011 21:26
 To: common-user@hadoop.apache.org
 Subject: Re: ClassNotFoundException while running quick start guide on
 Windows.
 
 Thanks Jeff, it was a problem with JAVA_HOME. I have another problem now
 though, I have this:
 
 $JAVA:  /cygdrive/c/Program Files/Java/jdk1.6.0_26/bin/java
 $JAVA_HEAP_MAX:  -Xmx1000m
 $HADOOP_OPTS:  -Dhadoop.log.dir=C:\Users\Drew
 Gross\Documents\Projects\discom\hadoop-0.21.0\logs
 -Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=C:\Users\Drew
 Gross\Documents\Projects\discom\hadoop-0.21.0\ -Dhadoop.id.str= -
 Dhadoop.root.logger=INFO,console
  -Djava.library.path=/cygdrive/c/Users/Drew
 Gross/Documents/Projects/discom/hadoop-0.21.0/lib/native/
 -Dhadoop.policy.file=hadoop-policy.xml
 $CLASS:  org.apache.hadoop.util.RunJar
 Exception in thread main java.lang.NoClassDefFoundError:
 Gross\Documents\Projects\discom\hadoop-0/21/0\logs
 Caused by: java.lang.ClassNotFoundException:
 Gross\Documents\Projects\discom\hadoop-0.21.0\logs
         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:
 Gross\Documents\Projects\discom\hadoop-0.21.0\logs.  Program will exit.
 
 (This is with some extra debugging info added by me in bin/hadoop)
 
 It looks like the windows style file names are causing problems, especially 
 the
 spaces. Has anyone encountered this before, and know how to fix? I tried
 escaping the spaces and surrounding the file paths with quotes (not at the
 same time), but that didn't help.
 
 Drew
 
 
 On Tue, Jun 21, 2011 at 6:24 AM, madhu phatak phatak@gmail.com
 wrote:
 
  I think the jar have some issuses where its not able to read the Main
  class from manifest . try unjar the jar and see in Manifest.xml what
  is the main class and then run as follows
 
   bin/hadoop jar hadoop-*-examples.jar Full qualified main class grep
  input output 'dfs[a-z.]+'
  On Thu, Jun 16, 2011 at 10:23 AM, Drew Gross drew.a.gr...@gmail.com
 wrote:
 
   Hello,
  
   I'm trying to run the example from the quick start guide on Windows
   and I get this error:
  
   $ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+'
   Exception in thread main java.lang.NoClassDefFoundError:
   Caused by: java.lang.ClassNotFoundException:
          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: .  Program will exit.
   Exception in thread main java.lang.NoClassDefFoundError:
   Gross\Documents\Projects\discom\hadoop-0/21/0\logs
   Caused by: java.lang.ClassNotFoundException:
   Gross\Documents\Projects\discom\hadoop-0.21.0\logs
          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:
   Gross\Documents\Projects\discom\hadoop-0.21.0\logs.  Program will
 exit.
  
   Does anyone know what I need to change?
  
   Thank you.
  
   From, Drew
  
   --
   Forget the environment. Print this e-mail immediately. Then burn it.
  
 
 
 
 --
 Forget the environment. Print this e-mail immediately. Then burn it.


Re: ClassNotFoundException while running quick start guide on Windows.

2011-06-21 Thread madhu phatak
I think the jar have some issuses where its not able to read the Main class
from manifest . try unjar the jar and see in Manifest.xml what is the main
class and then run as follows

 bin/hadoop jar hadoop-*-examples.jar Full qualified main class grep input
output 'dfs[a-z.]+'
On Thu, Jun 16, 2011 at 10:23 AM, Drew Gross drew.a.gr...@gmail.com wrote:

 Hello,

 I'm trying to run the example from the quick start guide on Windows and I
 get this error:

 $ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+'
 Exception in thread main java.lang.NoClassDefFoundError:
 Caused by: java.lang.ClassNotFoundException:
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: .  Program will exit.
 Exception in thread main java.lang.NoClassDefFoundError:
 Gross\Documents\Projects\discom\hadoop-0/21/0\logs
 Caused by: java.lang.ClassNotFoundException:
 Gross\Documents\Projects\discom\hadoop-0.21.0\logs
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:
 Gross\Documents\Projects\discom\hadoop-0.21.0\logs.  Program will exit.

 Does anyone know what I need to change?

 Thank you.

 From, Drew

 --
 Forget the environment. Print this e-mail immediately. Then burn it.



Re: ClassNotFoundException while running quick start guide on Windows.

2011-06-21 Thread Drew Gross
Thanks Jeff, it was a problem with JAVA_HOME. I have another problem
now though, I have this:

$JAVA:  /cygdrive/c/Program Files/Java/jdk1.6.0_26/bin/java
$JAVA_HEAP_MAX:  -Xmx1000m
$HADOOP_OPTS:  -Dhadoop.log.dir=C:\Users\Drew
Gross\Documents\Projects\discom\hadoop-0.21.0\logs
-Dhadoop.log.file=hadoop.log -Dhadoop.home.dir=C:\Users\Drew
Gross\Documents\Projects\discom\hadoop-0.21.0\ -Dhadoop.id.str=
-Dhadoop.root.logger=INFO,console
 -Djava.library.path=/cygdrive/c/Users/Drew
Gross/Documents/Projects/discom/hadoop-0.21.0/lib/native/
-Dhadoop.policy.file=hadoop-policy.xml
$CLASS:  org.apache.hadoop.util.RunJar
Exception in thread main java.lang.NoClassDefFoundError:
Gross\Documents\Projects\discom\hadoop-0/21/0\logs
Caused by: java.lang.ClassNotFoundException:
Gross\Documents\Projects\discom\hadoop-0.21.0\logs
        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:
Gross\Documents\Projects\discom\hadoop-0.21.0\logs.  Program will
exit.

(This is with some extra debugging info added by me in bin/hadoop)

It looks like the windows style file names are causing problems,
especially the spaces. Has anyone encountered this before, and know
how to fix? I tried escaping the spaces and surrounding the file paths
with quotes (not at the same time), but that didn't help.

Drew


On Tue, Jun 21, 2011 at 6:24 AM, madhu phatak phatak@gmail.com wrote:

 I think the jar have some issuses where its not able to read the Main class
 from manifest . try unjar the jar and see in Manifest.xml what is the main
 class and then run as follows

  bin/hadoop jar hadoop-*-examples.jar Full qualified main class grep input
 output 'dfs[a-z.]+'
 On Thu, Jun 16, 2011 at 10:23 AM, Drew Gross drew.a.gr...@gmail.com wrote:

  Hello,
 
  I'm trying to run the example from the quick start guide on Windows and I
  get this error:
 
  $ bin/hadoop jar hadoop-*-examples.jar grep input output 'dfs[a-z.]+'
  Exception in thread main java.lang.NoClassDefFoundError:
  Caused by: java.lang.ClassNotFoundException:
         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: .  Program will exit.
  Exception in thread main java.lang.NoClassDefFoundError:
  Gross\Documents\Projects\discom\hadoop-0/21/0\logs
  Caused by: java.lang.ClassNotFoundException:
  Gross\Documents\Projects\discom\hadoop-0.21.0\logs
         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:
  Gross\Documents\Projects\discom\hadoop-0.21.0\logs.  Program will exit.
 
  Does anyone know what I need to change?
 
  Thank you.
 
  From, Drew
 
  --
  Forget the environment. Print this e-mail immediately. Then burn it.
 



--
Forget the environment. Print this e-mail immediately. Then burn it.