javax/sound/midi/Soundbanks/GetSoundBankSecurityException/GetSoundBankSecurityException.java failes with FileSystemException

XMLWordPrintable

    • Fix Understood
    • generic
    • windows

      GetSoundBankSecurityException.java was added in JDK-8312535.
      On JDK 8, it fails with a FileSystemException:

      java.nio.file.FileSystemException: C:\\work\\jdk\\test\\JTwork\\scratch\\sound.bank: The process
       cannot access the file because it is being used by another process.

              at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
              at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
              at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
              at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
              at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
              at java.nio.file.Files.delete(Files.java:1126)
              at GetSoundBankSecurityException.main(GetSoundBankSecurityException.java:47)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.lang.reflect.Method.invoke(Method.java:498)
              at com.sun.javatest.regtest.agent.MainWrapper$MainTask.run(MainWrapper.java:138)
              at java.lang.Thread.run(Thread.java:750)

      This test creates an empty sound bank file and calls SoundbankReader.getSoundbank(file).
      It then attempts to delete the file using Files.delete(), resulting in the FileSystemException.
      This exception does not occur on JDK 11, 17, and 21.
      environment:
       Windows Server 2022
       1.8.0_432

            Assignee:
            Sergey Bylokhov
            Reporter:
            Takuya Kiriyama
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: