Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6638787

On Vista,"java.io.IOException: unable to rename" thrown if -Duser.home point to a long filename

    XMLWordPrintable

    Details

      Description

      If -Duser.home point to a directory that has a extremely long name, kerneljre thrown "java.io.IOException: unable to rename" and "Error downloading bundle"

      Test run with:
      java version "1.6.0_10-ea"
      Java(TM) SE Runtime Environment (build 1.6.0_10-ea-b07)
      Java HotSpot(TM) Client VM (build 1.6.0_10-ea-b07, mixed mode)

      Steps to reproduce:
      1. Install the kernel jre "*windows-i586-p-iftw-k.exe"
      2. Make sure run the test from kerneljre's "initial form"
         (either immediately(before Kernel has time to finish background downloading)run test after install, or perform step 3 4)
      (optinal)3. Kill the background download ( by killing the "java" process )
      (optinal)4. Remove all files under ${ProgramFiles}/Java/jre6/lib/bundles/
      5. Create a dir with a long name, for example
      c:/temp/this_is_a_test_for_kerneljre_bug_reproduce_long_filename_can_not_used_as_userhome_on_vista_jsn_6.0_UR_int-pit_sec_kerneljre_6.0_U_test_for_kerneljre_bug_reproduce
      6. Run a app that require additional components with -Duser.home=a_long_filename
      "java.io.IOException: unable to rename" and "Error downloading bundle" thrown
      ( If follow the same steps, run the same app with -Duser.home=a_short_filename, no exception and error )

      Any app that require additional components can reproduce the issue,
      in my case, for example((BindLoopback.java attached)):
      "${JAVA_HOME}/bin/java" \
      -Duser.home=C:/temp/this_is_a_test_for_kerneljre_bug_reproduce_long_filename_can_not_used_as_userhome_on_vista_jsn_6.0_UR_int-pit_sec_kerneljre_6.0_U_test_for_kerneljre_bug_reproduce \
      BindLoopback

      Error downloading bundle for java/net/InetAddress.class:
      java.io.IOException: unable to rename C:\temp\this_is_a_test_for_kerneljre_bug_reproduce_long_filename_can_not_used_as_userhome_on_vista_jsn_6.0_UR_int-pit_sec_kerneljre_6.0_U_test_for_kerneljre_bug_reproduce\appdata\locallow\kerneljre1.6.0_10-eajava_net\lib\bundles\java_net.jar.tmp to C:\temp\this_is_a_test_for_kerneljre_bug_reproduce_long_filename_can_not_used_as_userhome_on_vista_jsn_6.0_UR_int-pit_sec_kerneljre_6.0_U_test_for_kerneljre_bug_reproduce\appdata\locallow\kerneljre1.6.0_10-eajava_net\lib\bundles\java_net.jar
              at sun.jkernel.Bundle.unpackBundle(Unknown Source)
              at sun.jkernel.Bundle.install(Unknown Source)
              at sun.jkernel.Bundle.install(Unknown Source)
              at sun.jkernel.DownloadManager.doGetBootClassPathEntryForResource(Unknown Source)
              at sun.jkernel.DownloadManager.access$500(Unknown Source)
              at sun.jkernel.DownloadManager$3.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.jkernel.DownloadManager.getBootClassPathEntryForResource(Unknown Source)
              at sun.jkernel.DownloadManager.getBootClassPathEntryForClass(Unknown Source)
              at java.lang.ClassLoader.findBootstrapClass(Native Method)
              at java.lang.ClassLoader.findBootstrapClass0(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClassInternal(Unknown Source)
              at BindLoopback.main(BindLoopback.java:21)
      Error downloading bundle for java/net/InetAddress.class:
      java.io.FileNotFoundException: C:\temp\this_is_a_test_for_kerneljre_bug_reproduce_long_filename_can_not_used_as_userhome_on_vista_jsn_6.0_UR_int-pit_sec_kerneljre_6.0_U_test_for_kerneljre_bug_reproduce\appdata\locallow\kerneljre1.6.0_10-ea-bundles\java_net.zip (The system cannot find the file specified)
              at java.io.FileInputStream.open(Native Method)
              at java.io.FileInputStream.<init>(Unknown Source)
              at sun.jkernel.Bundle.unpackBundle(Unknown Source)
              at sun.jkernel.Bundle.install(Unknown Source)
              at sun.jkernel.Bundle.install(Unknown Source)
              at sun.jkernel.DownloadManager.doGetBootClassPathEntryForResource(Unknown Source)
              at sun.jkernel.DownloadManager.access$500(Unknown Source)
              at sun.jkernel.DownloadManager$3.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.jkernel.DownloadManager.getBootClassPathEntryForResource(Unknown Source)
              at sun.jkernel.DownloadManager.getBootClassPathEntryForClass(Unknown Source)
              at sun.misc.Launcher$ExtClassLoader.findClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClassInternal(Unknown Source)
              at BindLoopback.main(BindLoopback.java:21)
      Exception in thread "main" java.lang.NoClassDefFoundError: java/net/InetAddress
              at BindLoopback.main(BindLoopback.java:21)
      Caused by: java.lang.ClassNotFoundException: java.net.InetAddress
              at java.net.URLClassLoader$1.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClass(Unknown Source)
              at java.lang.ClassLoader.loadClassInternal(Unknown Source)
              ... 1 more
      ( If follow the same steps, run the same app with -Duser.home=a_short_filename, the test pass as expected)

      Test run on Windows Vista Enterprise 32-bit Operating System
      PROCESSOR_ARCHITECTURE=x86
      PROCESSOR_IDENTIFIER=x86 Family 15 Model 3 Stepping 4, GenuineIntel

      The "NtfsDisable8dot3NameCreation" value is 0 in registry, and no problem to rename or delete a dir/file with such long filename in command line.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            amlu Amy Lu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: