Hadoop Common
  1. Hadoop Common
  2. HADOOP-207

Patch to HADOOP-96 uses long deprecated call

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.2.0
    • Fix Version/s: 0.2.1
    • Component/s: None
    • Labels:
      None

      Description

      System.getenv() was deprecated in Java 1.4. My mixed Java 1.4/Java 1.5 cluster won't start up with this code in place. Should probably change the scripts to pass the necessary environment variables in using -D or explicit arguments.

      1. logging.patch
        3 kB
        Hairong Kuang
      2. logging.patch
        3 kB
        Hairong Kuang

        Activity

        Hide
        Hairong Kuang added a comment -

        This patch allows hadoop logging works with java1.4. It also makes the .log name consistent with .log name.

        Show
        Hairong Kuang added a comment - This patch allows hadoop logging works with java1.4. It also makes the .log name consistent with .log name.
        Hide
        Doug Cutting added a comment -

        The 1.4 compatibility issue could be worthy of fixing in 0.2.1 (which I can't release until svn writes are re-enabled... checking... and it looks like they just were!). What exactly is the problem on your mixed cluster? Should I try to squeeze this into the 0.2.1 release?

        I'm concerned about the other changes on Win32. Have you tested that the new Java command-line parameters work correctly if they contain spaces? In particular, we should test that these work correctly when either the username or the log directory path contain spaces.

        Thanks!

        Show
        Doug Cutting added a comment - The 1.4 compatibility issue could be worthy of fixing in 0.2.1 (which I can't release until svn writes are re-enabled... checking... and it looks like they just were!). What exactly is the problem on your mixed cluster? Should I try to squeeze this into the 0.2.1 release? I'm concerned about the other changes on Win32. Have you tested that the new Java command-line parameters work correctly if they contain spaces? In particular, we should test that these work correctly when either the username or the log directory path contain spaces. Thanks!
        Hide
        Owen O'Malley added a comment -

        If you run Hadoop 0.2.0 on jdk 1.4.2 it gets an exception that stops the servers at start up.

        Show
        Owen O'Malley added a comment - If you run Hadoop 0.2.0 on jdk 1.4.2 it gets an exception that stops the servers at start up.
        Hide
        Doug Cutting added a comment -

        Is that because I mistakenly compiled 0.2.0 with JDK 1.5, or is there something more going on? How does it fail? What's the minimal patch? (I'll start trying this now and will soon find out, since I'm about to start building & testing release 0.2.1 using JDK 1.4, but any hints are welcome.)

        Show
        Doug Cutting added a comment - Is that because I mistakenly compiled 0.2.0 with JDK 1.5, or is there something more going on? How does it fail? What's the minimal patch? (I'll start trying this now and will soon find out, since I'm about to start building & testing release 0.2.1 using JDK 1.4, but any hints are welcome.)
        Hide
        Owen O'Malley added a comment -

        Assuming you have the trivial program:

        public class test {
        public static void main(String[] args)

        { System.out.println("Home is " + System.getenv("HOME")); }

        }

        Compiling under 1.5 produces no warnings.
        Compiling under 1.4.2 produces a depreciated warning for getenv.

        Running either the 1.5 or 1.4.2 class file under jvm 1.5 works fine.
        Running the 1.4 binary under the jvm 1.4.2 throws:
        Exception in thread "main" java.lang.Error: getenv no longer supported, use properties and -D instead: HOME
        at java.lang.System.getenv(System.java:691)
        at test.main(test.java:3)

        Show
        Owen O'Malley added a comment - Assuming you have the trivial program: public class test { public static void main(String[] args) { System.out.println("Home is " + System.getenv("HOME")); } } Compiling under 1.5 produces no warnings. Compiling under 1.4.2 produces a depreciated warning for getenv. Running either the 1.5 or 1.4.2 class file under jvm 1.5 works fine. Running the 1.4 binary under the jvm 1.4.2 throws: Exception in thread "main" java.lang.Error: getenv no longer supported, use properties and -D instead: HOME at java.lang.System.getenv(System.java:691) at test.main(test.java:3)
        Hide
        Doug Cutting added a comment -

        I just committed this. The patch did not correctly handle paths with spaces on Win32. I fixed that by converting them to space-free DOS paths. Thanks, Hairong.

        Show
        Doug Cutting added a comment - I just committed this. The patch did not correctly handle paths with spaces on Win32. I fixed that by converting them to space-free DOS paths. Thanks, Hairong.

          People

          • Assignee:
            Hairong Kuang
            Reporter:
            Bryan Pendleton
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development