Guest herzjanny Posted May 28, 2014 Posted May 28, 2014 I am getting the following error trying to read directories on SLES 11. It occurs on several machines and any directory, so it is not a corrupted directory problem. Exception in thread "main" java.nio.file.DirectoryIteratorException: java.nio.file.FileSystemException: /var/opt/util/java8/jdk/jdk/src/share/classes/sun/util/cldr/resources/21_0_1/common/main: Unknown error 9572 at sun.nio.fs.UnixDirectoryStream$UnixDirectoryIterat or.readNextEntry(UnixDirectoryStream.java:172) at sun.nio.fs.UnixDirectoryStream$UnixDirectoryIterat or.hasNext(UnixDirectoryStream.java:201) at build.tools.cldrconverter.CLDRConverter.readBundle List(CLDRConverter.java:256) at build.tools.cldrconverter.CLDRConverter.main(CLDRC onverter.java:184) Caused by: java.nio.file.FileSystemException: /var/opt/util/java8/jdk/jdk/src/share/classes/sun/util/cldr/resources/21_0_1/common/main: Unknown error 9572 at sun.nio.fs.UnixException.translateToIOException(Un ixException.java:91) at sun.nio.fs.UnixException.asIOException(UnixExcepti on.java:111) at sun.nio.fs.UnixDirectoryStream$UnixDirectoryIterat or.readNextEntry(UnixDirectoryStream.java:171) ... 3 more It appears as if the final iterative call to readdir after all the directory elements have been read is causing an unknown exception that is being propagated back from the JNI call. The following is a program I wrote to test this that will cause the error; I wanted to try to isolate the issue. import java.io.File; import java.nio.file.DirectoryStream; import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.Path; import java.util.*; public class tstconv { public static void main(String[] args) throws Exception { tstconv.testit(); } public static void testit() throws Exception { Path path = FileSystems.getDefault().getPath("/home/gch"); try (DirectoryStream<Path> dirStr = Files.newDirectoryStream(path)) { for (Path entry : dirStr) { String fileName = entry.getFileName().toString(); System.out.println(fileName); } } return; } } The above will print out all the files in the directory before failing. Strangely, I am not getting the error on one box, and the only seemingly relevant difference in its setup is that it has glibc package glibc-2.11.1-0.46.1, while the others all have glibc-2.11.1-0.52.1. I have not been able to find anything helpful out on the web thus far. Continue reading... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.