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

(fs) FileAlreadyExistsException when use Files.move with REPLACE_EXISTING

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • Icon: P4 P4
    • None
    • 7u2, 7u15
    • core-libs
    • windows_2012

      FULL PRODUCT VERSION :
      java version " 1.7.0_15 "
      Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
      Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.2.9200]

      A DESCRIPTION OF THE PROBLEM :
      . Use the Files.move(from,to,REPLACE_EXISTING) to move a file.
      . prepare a text file with " mock content " in that file
      . got the error like below sometimes.

      Caused by: java.nio.file.FileAlreadyExistsException: G:\apache-tomcat\temp\tmp1540072504027239704.tmp -> G:\share1\0\58bcafba-2f0e-4e81-83e7-34d60b4ac3e9
                     at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:81)
                     at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
                     at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:387)
                     at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:286)
                     at java.nio.file.Files.move(Files.java:1339)


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      . Use the Files.move(from,to,REPLACE_EXISTING) to move a file.
      . prepare a text file with " mock content " in that file
      . got the error like below sometimes.


      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Caused by: java.nio.file.FileAlreadyExistsException: G:\apache-tomcat\temp\tmp1540072504027239704.tmp -> G:\share1\0\58bcafba-2f0e-4e81-83e7-34d60b4ac3e9
                     at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:81)
                     at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
                     at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:387)
                     at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:286)
                     at java.nio.file.Files.move(Files.java:1339)


      REPRODUCIBILITY :
      This bug can be reproduced often.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: