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

cannot open file "NUL:"

    XMLWordPrintable

Details

    • b06
    • b20
    • x86_64
    • windows
    • Verified

    Backports

      Description

        A DESCRIPTION OF THE PROBLEM :
        with java update cpuapr2022 (8u331 11.0.15 and 18.0.1) undertow is broken for windows.

        this code:
        https://github.com/xnio/xnio/blob/3.x/api/src/main/java/org/xnio/channels/Channels.java#L1098
        return new FileOutputStream("NUL:").getChannel();
         

        is broken after this "improvement" (ticket JDK-8278356 is not public, why?)
        https://github.com/openjdk/jdk/commit/395bb5b7f97f2549da89641257fe56712856b49d "8278356: Improve file creation"

        2022-04-21 11:06:26,989 [XNIO-10 task-10] {} ERROR io.undertow.request.io UT005090: Unexpected failure
        java.lang.NoClassDefFoundError: Could not initialize class org.xnio.channels.Channels

        REGRESSION : Last worked in version 8

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        run test program below.




        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        No Exception.

        ACTUAL -
         Exception in thread "main" java.io.FileNotFoundException: Invalid file path

        ---------- BEGIN SOURCE ----------
        import java.io.FileOutputStream;

        public class NulFile {
            public static void main(String[] args) throws Exception {
                new FileOutputStream("NUL:");
            }
        }
        ---------- END SOURCE ----------

        CUSTOMER SUBMITTED WORKAROUND :
        set system property: -Djdk.io.File.enableADS=true

        FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

                bpb Brian Burkhalter
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                17 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: