https://bz.apache.org/bugzilla/show_bug.cgi?id=63314
--- Comment #5 from David St. Denis <[email protected]> --- Created attachment 36924 --> https://bz.apache.org/bugzilla/attachment.cgi?id=36924&action=edit test script Running this script on a real (non virtual) Windows machine works fine. I've never had an error yet. At least in the several dozen times I've run it never experienced an error. However tunning this script on a Windows virtual machine I get the following 2 types of errors and warnings intermittently. More often the AccessDenied trace than the FileSystemException. E:\udu\t100.xml:79: Failed to copy E:\udu\SSS\fA670 to E:\udu\DDD\fA670 due to java.nio.file.AccessDeniedException E:\udu\DDD\fA670 at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:899) at org.apache.tools.ant.taskdefs.Copy.execute(Copy.java:567) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99) at org.apache.tools.ant.Task.perform(Task.java:350) at java.util.Vector.forEach(Vector.java:1249) at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:67) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99) at org.apache.tools.ant.Task.perform(Task.java:350) at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:391) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99) at org.apache.tools.ant.Task.perform(Task.java:350) at org.apache.tools.ant.taskdefs.Parallel$TaskRunnable.run(Parallel.java:454) at java.lang.Thread.run(Thread.java:745) Caused by: java.nio.file.AccessDeniedException: E:\udu\DDD\fA670 at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:83) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) at sun.nio.fs.WindowsFileSystemProvider.newByteChannel(WindowsFileSystemProvider.java:230) at java.nio.file.spi.FileSystemProvider.newOutputStream(FileSystemProvider.java:434) at java.nio.file.Files.newOutputStream(Files.java:216) at org.apache.tools.ant.util.FileUtils.newOutputStream(FileUtils.java:1769) at org.apache.tools.ant.types.resources.FileResource.getOutputStream(FileResource.java:267) at org.apache.tools.ant.types.resources.FileResource.getOutputStream(FileResource.java:241) at org.apache.tools.ant.util.ResourceUtils.getOutputStream(ResourceUtils.java:791) at org.apache.tools.ant.util.ResourceUtils.copyUsingStreams(ResourceUtils.java:765) at org.apache.tools.ant.util.ResourceUtils.copyResource(ResourceUtils.java:435) at org.apache.tools.ant.util.FileUtils.copyFile(FileUtils.java:565) at org.apache.tools.ant.taskdefs.Copy.doFileOperations(Copy.java:882) ... 24 more OR E:\udu\t100.xml:79: Failed to copy E:\udu\SSS\fA298 to E:\udu\DDD\fA298 due to java.nio.file.FileSystemException E:\udu\DDD\fA298: The requested operation cannot be performed on a file with a user-mapped section open. at org.apache.tools.ant.taskdefs.Parallel.spinThreads(Parallel.java:395) at org.apache.tools.ant.taskdefs.Parallel.execute(Parallel.java:209) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99) at org.apache.tools.ant.Task.perform(Task.java:350) at org.apache.tools.ant.Target.execute(Target.java:449) at org.apache.tools.ant.Target.performTasks(Target.java:470) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388) at org.apache.tools.ant.Project.executeTarget(Project.java:1361) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1251) at org.apache.tools.ant.Main.runBuild(Main.java:834) at org.apache.tools.ant.Main.startAnt(Main.java:223) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101) AND always receive warnings of this type when the script is run: Attempt to copy E:\udu\SSS\fA714 to E:\udu\DDD\fA714 using NIO Channels failed due to 'E:\udu\DDD\fA714: The requested operation cannot be performed on a file with a user-mapped section open. Attempt to copy E:\udu\SSS\fA825 to E:\udu\DDD\fA825 using NIO Channels failed due to 'E:\udu\DDD\fA825: The requested operation cannot be performed on a file with a user-mapped section open. Attempt to copy E:\udu\SSS\fA888 to E:\udu\DDD\fA888 using NIO Channels failed due to 'E:\udu\DDD\fA888: The requested operation cannot be performed on a file with a user-mapped section open. My guess is this has more to do with the JVM interaction with the VM than Ant. And I'm aware that my problem here is that I'm copying to the same destination using multiple threads. In the real world this is separate Ant builds copying to the same destination independently, so it's not as easy to simply just not do as in this trivial concoction. -- You are receiving this mail because: You are the assignee for the bug.
