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

Linux: Exception in PackagerLib when moving file from /tmp

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P3
    • Resolution: Fixed
    • 8
    • 8
    • deploy

    Description

      The following fails under GNU/Linux:
      gradle -PBUILD_JAVADOC=true -PCOMPILE_WEBKIT=true all

            [jar] Building jar: /home/bothner/JWebPane/jfx/deploy/javafx-deploy-samples/dist/mediaplayer.jar
            [jar] adding directory META-INF/
            [jar] adding entry META-INF/MANIFEST.MF
            [jar] adding directory mediaplayer/
            [jar] adding entry mediaplayer/PlayerApp.class
            [jar] No Implementation-Title set.No Implementation-Version set.No Implementation-Vendor set.
            [jar] Location: /home/bothner/JWebPane/jfx/deploy/javafx-deploy-samples/build.xml:166:
            [ant] Exiting /home/bothner/JWebPane/jfx/deploy/javafx-deploy-samples/build.xml.
            [ant] Exiting /home/bothner/JWebPane/jfx/deploy/build.xml.
        [antcall] Exiting /home/bothner/JWebPane/jfx/build.xml.

      BUILD FAILED
      /home/bothner/JWebPane/jfx/build-src/build-components.xml:338: The following error occurred while executing this line:
      /home/bothner/JWebPane/jfx/build-src/build-components.xml:220: The following error occurred while executing this line:
      /home/bothner/JWebPane/jfx/build/xml_generated/build-deploy.xml:71: The following error occurred while executing this line:
      /home/bothner/JWebPane/jfx/build-src/build-components.xml:77: The following error occurred while executing this line:
      /home/bothner/JWebPane/jfx/deploy/build.xml:281: The following error occurred while executing this line:
      /home/bothner/JWebPane/jfx/deploy/javafx-deploy-samples/build.xml:171: Error: Failed to create jar file dist/mediaplayer.jar
              at com.sun.javafx.tools.ant.FXJar.execute(FXJar.java:154)
      Caused by: com.sun.javafx.tools.packager.PackagerException: Error: Failed to create jar file dist/mediaplayer.jar
              at com.sun.javafx.tools.packager.PackagerLib.packageAsJar(PackagerLib.java:326)
              at com.sun.javafx.tools.ant.FXJar.execute(FXJar.java:152)
              ... 81 more
      Caused by: java.io.FileNotFoundException: /tmp/tempcopy6433419252498180291.jar (No such file or directory)
              at java.util.zip.ZipFile.open(Native Method)
              at java.util.zip.ZipFile.<init>(ZipFile.java:220)
              at java.util.zip.ZipFile.<init>(ZipFile.java:150)
              at java.util.jar.JarFile.<init>(JarFile.java:160)
              at java.util.jar.JarFile.<init>(JarFile.java:124)
              at com.sun.javafx.tools.packager.PackagerLib.copyFromOtherJar(PackagerLib.java:1458)
              at com.sun.javafx.tools.packager.PackagerLib.jar(PackagerLib.java:1400)
              at com.sun.javafx.tools.packager.PackagerLib.packageAsJar(PackagerLib.java:322)
              ... 82 more

      Total time: 15 seconds
      :appsLinux FAILED

      The failure is because of a bug in
      modules/fxpackager/src/main/java/com/sun/javafx/tools/packager/PackagerLib.java
      The problem is line 28:
          jarToUpdate.renameTo(newInputJar);
      This will typically fail under Unix-like systems, because newInputJar is in the /tmp filesystem, while jarToUpdate may be on some other file-system, such as /home.

      The fix is to use java.nio.file.Files#move. Patch follows.

      Attachments

        Activity

          People

            kcr Kevin Rushforth
            pbothner Per Bothner (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported: