Replacing default FileSystemProvider
Alan Bateman
Alan.Bateman at oracle.com
Sun Mar 21 15:20:30 UTC 2021
On 21/03/2021 10:04, Michael Hall wrote:
> (base) Michaels-MacBook-Pro:halfpipe_jpkg mjh$ /usr/libexec/java_home -v 9 --exec java -cp .:outputdir/HalfPipe.app/Contents/app/macnio2.jar -Djava.library.path=outputdir/HalfPipe.app/Conents/app -Djava.nio.file.spi.DefaultFileSystemProvider=us.hall.trz.osx.MacFileSystemProvider Test
> Exception in thread "main" java.lang.Error: java.lang.NullPointerException
> at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:141)
> at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.access$100(FileSystems.java:102)
> at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:111)
> at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:109)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(FileSystems.java:109)
> at java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.<clinit>(FileSystems.java:103)
> at java.base/java.nio.file.FileSystems.getDefault(FileSystems.java:190)
> at Test.main(Test.java:6)
> Caused by: java.lang.NullPointerException
> at java.base/java.io.File.toPath(File.java:2300)
>
Thanks, I understand this now and I can duplicate it. The issue is
re-implementation and other work on ZipFile means leads to a
bootstrapping issue when the default provider is override and deployed
in JAR file. Thanks for persisting with the mails on this, I'll create a
bug to track this.
-Alan
More information about the nio-dev
mailing list