XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.21.0
    • Fix Version/s: None
    • Component/s: build
    • Labels:
    • Environment:

      Mac OS X (but the same effect in linux)

      $java -version
      java version "1.6.0_24"
      Java(TM) SE Runtime Environment (build 1.6.0_24-b07-334-10M3326)
      Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02-334, mixed mode)

      Description

      I tried to execute: ./bin/hadoop namenode -format in hadoop-0.21.0 inside a folder with path: ~/Desktop/my test/hadoop-0.21.0/
      But i kept receiving the following error:

      Exception in thread "main" java.lang.NoClassDefFoundError: test/hadoop-0/21/0/bin////logs
      Caused by: java.lang.ClassNotFoundException: me.hadoop-0.21.0.bin....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:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

      Tried to change the language just to test what would happen. So I got a same error with a folder name with spaces:

      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:307)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

      (You can notice the ???, might this be a java issue?)

      I was able to run it only in folder names that didn't include spaces. Both english and greek.

      I tried to trace this issue and I found that the problem is in the HADOOP_HOME/hdfs script. On the last line where: exec "$JAVA" $JAVA_HEAP_MAX $HADOOP_OPTS $CLASS "$@" tries to be executed, variable HADOOP_OPTS has white spaces which produce the above errors.

      A solution to this problem could be to include double quotes to each path when they are collected and call exec command with eval at the front.

      I found a workaround to this issue by adding:

      tmp=`echo ${HADOOP_OPTS// /\\\ }`
      eval exec "$JAVA" $JAVA_HEAP_MAX $(echo ${tmp//
      -/\ -}) " " $CLASS "$@"

      This code basically it added backslashes in front of each space in a path.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                andronat Anastasis Andronidis
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: