-
Bug
-
Resolution: Fixed
-
P3
-
9, 13
-
b18
-
x86
-
os_x
ADDITIONAL SYSTEM INFORMATION :
macOS 10.14.6, Tested with Oracle JDK 8u202, 8u221 and 13
A DESCRIPTION OF THE PROBLEM :
Beginning with Java 9 it is no longer possible to call force() on a FileChannel pointing to a file on a mounted WebDAV drive (similar reports for CIFS drives on Linux that I can not confirm).
REGRESSION : Last worked in version 8u221
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Mount a WebDAV-Drive (in Finder press âÂÂK). For Testing you can use a URL obtained from the upper right corner of webdavserver.com
2. Run attached test class, provide an absolute path to a any existing or nonexisting file inside the mounted drive as arg[0]
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No exception
ACTUAL -
java.io.IOException: Invalid argument
at java.base/sun.nio.ch.FileDispatcherImpl.force0(Native Method)
at java.base/sun.nio.ch.FileDispatcherImpl.force(FileDispatcherImpl.java:82)
at java.base/sun.nio.ch.FileChannelImpl.force(FileChannelImpl.java:461)
---------- BEGIN SOURCE ----------
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
public class ChannelForceTest {
public static void main(String args[]) {
if (args.length != 1) {
System.out.println("Run with arg[0] being an absolute path to a webdav-mounted directory");
System.exit(1);
}
Path p = Paths.get(args[0]);
try (FileChannel ch = FileChannel.open(p, StandardOpenOption.WRITE, StandardOpenOption.CREATE)) {
ch.force(true); // fails
System.out.println("No exception under JDK 8");
} catch (IOException e) {
System.out.println("Exception under JDK 9+");
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
FREQUENCY : always
macOS 10.14.6, Tested with Oracle JDK 8u202, 8u221 and 13
A DESCRIPTION OF THE PROBLEM :
Beginning with Java 9 it is no longer possible to call force() on a FileChannel pointing to a file on a mounted WebDAV drive (similar reports for CIFS drives on Linux that I can not confirm).
REGRESSION : Last worked in version 8u221
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Mount a WebDAV-Drive (in Finder press âÂÂK). For Testing you can use a URL obtained from the upper right corner of webdavserver.com
2. Run attached test class, provide an absolute path to a any existing or nonexisting file inside the mounted drive as arg[0]
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No exception
ACTUAL -
java.io.IOException: Invalid argument
at java.base/sun.nio.ch.FileDispatcherImpl.force0(Native Method)
at java.base/sun.nio.ch.FileDispatcherImpl.force(FileDispatcherImpl.java:82)
at java.base/sun.nio.ch.FileChannelImpl.force(FileChannelImpl.java:461)
---------- BEGIN SOURCE ----------
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
public class ChannelForceTest {
public static void main(String args[]) {
if (args.length != 1) {
System.out.println("Run with arg[0] being an absolute path to a webdav-mounted directory");
System.exit(1);
}
Path p = Paths.get(args[0]);
try (FileChannel ch = FileChannel.open(p, StandardOpenOption.WRITE, StandardOpenOption.CREATE)) {
ch.force(true); // fails
System.out.println("No exception under JDK 8");
} catch (IOException e) {
System.out.println("Exception under JDK 9+");
e.printStackTrace();
}
}
}
---------- END SOURCE ----------
FREQUENCY : always
- relates to
-
JDK-8265018 (fs) Build issue with FileDispatcherImpl.c:31:10: fatal error: 'sys/mount.h' file not found (aix)
- Resolved