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

Overriding the default file system provider fails with a modular image

    XMLWordPrintable

    Details

      Description

      This test configures a FileSystemProvider that interposes over the otherwise default provider. This leads to a recursive initialization issue during startup because the file system provider is located via the system class loader. Here's the output of the test when run with a build of jigsaw/m2:

      command: main -Djava.nio.file.spi.DefaultFileSystemProvider=TestProvider SetDefaultProvider
      reason: User specified action: run main/othervm -Djava.nio.file.spi.DefaultFileSystemProvider=TestProvider SetDefaultProvider
      elapsed time (seconds): 0.277
      ----------System.out:(0/0)----------
      ----------System.err:(51/3169)----------
      Error: A JNI error has occurred, please check your installation and try again
      Exception in thread "main" java.lang.Error: java.lang.NullPointerException
      at java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:128)
      at java.nio.file.FileSystems$DefaultFileSystemHolder.access$000(FileSystems.java:89)
      at java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:98)
      at java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:96)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(FileSystems.java:96)
      at java.nio.file.FileSystems$DefaultFileSystemHolder.<clinit>(FileSystems.java:90)
      at java.nio.file.FileSystems.getDefault(FileSystems.java:176)
      at java.io.File.toPath(File.java:2236)
      at jdk.internal.jimage.ImageReader.open(ImageReader.java:71)
      at sun.misc.JImageCache.get(JImageCache.java:74)
      at sun.misc.URLClassPath$JImageLoader.<init>(URLClassPath.java:1120)
      at sun.misc.URLClassPath$3.run(URLClassPath.java:373)
      at sun.misc.URLClassPath$3.run(URLClassPath.java:361)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.misc.URLClassPath.getLoader(URLClassPath.java:360)
      at sun.misc.URLClassPath.getLoader(URLClassPath.java:337)
      at sun.misc.URLClassPath.getResource(URLClassPath.java:203)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:426)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:413)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:359)
      at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:504)
      Caused by: java.lang.NullPointerException
      at java.io.File.toPath(File.java:2236)
      at jdk.internal.jimage.ImageReader.open(ImageReader.java:71)
      at sun.misc.JImageCache.get(JImageCache.java:74)
      at sun.misc.URLClassPath$JImageLoader.<init>(URLClassPath.java:1120)
      at sun.misc.URLClassPath$3.run(URLClassPath.java:373)
      at sun.misc.URLClassPath$3.run(URLClassPath.java:361)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.misc.URLClassPath.getLoader(URLClassPath.java:360)
      at sun.misc.URLClassPath.getLoader(URLClassPath.java:337)
      at sun.misc.URLClassPath.getResource(URLClassPath.java:203)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:365)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:426)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:359)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:346)
      at java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:118)
      ... 26 more

      This issue is going to be tricky to resolve.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alanb Alan Bateman
                Reporter:
                alanb Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: