JDK-8151660 : Revert NativeBuffer.java to use jdk.internal.ref.Cleaner
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-03-10
  • Updated: 2017-03-21
  • Resolved: 2016-03-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b110Fixed
Related Reports
Relates :  
Description
JDK-8149925 causes the system initialization fail if -Djava.system.class.loader is used to set a custom class loader.

This issue is to revert NativeBuffer.java to use jdk.internal.ref.Cleaner until JDK-8151571 is resolved.

Error occurred during initialization of VM
java.lang.ExceptionInInitializerError
	at sun.nio.fs.NativeBuffer.<init>(NativeBuffer.java:61)
	at sun.nio.fs.NativeBuffers.allocNativeBuffer(NativeBuffers.java:49)
	at sun.nio.fs.UnixNativeDispatcher.copyToNativeBuffer(UnixNativeDispatcher.java:44)
	at sun.nio.fs.UnixNativeDispatcher.stat(UnixNativeDispatcher.java:289)
	at sun.nio.fs.UnixFileAttributes.get(UnixFileAttributes.java:70)
	at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:52)
	at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:145)
	at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
	at java.nio.file.Files.readAttributes(Files.java:1739)
	at java.util.zip.ZipFile$Source.get(ZipFile.java:924)
	at java.util.zip.ZipFile.<init>(ZipFile.java:213)
	at java.util.zip.ZipFile.<init>(ZipFile.java:145)
	at java.util.jar.JarFile.<init>(JarFile.java:352)
	at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:731)
	at sun.misc.URLClassPath$JarLoader.access$600(URLClassPath.java:620)
	at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:676)
	at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:669)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:668)
	at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:643)
	at sun.misc.URLClassPath$3.run(URLClassPath.java:394)
	at sun.misc.URLClassPath$3.run(URLClassPath.java:380)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath.getLoader(URLClassPath.java:379)
	at sun.misc.URLClassPath.getLoader(URLClassPath.java:356)
	at sun.misc.URLClassPath.getResource(URLClassPath.java:222)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:365)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:262)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:372)
	at java.lang.SystemClassLoaderAction.run(ClassLoader.java:2203)
	at java.lang.SystemClassLoaderAction.run(ClassLoader.java:2189)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1450)
	at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1430)
Caused by: java.lang.IllegalStateException: recursive invocation
	at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1444)
	at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1430)
	at jdk.internal.misc.InnocuousThread.<init>(InnocuousThread.java:61)
	at jdk.internal.misc.InnocuousThread.<init>(InnocuousThread.java:50)
	at jdk.internal.ref.CleanerImpl$InnocuousThreadFactory$1.run(CleanerImpl.java:330)
	at jdk.internal.ref.CleanerImpl$InnocuousThreadFactory$1.run(CleanerImpl.java:327)
	at java.security.AccessController.doPrivileged(Native Method)
	at jdk.internal.ref.CleanerImpl$InnocuousThreadFactory.newThread(CleanerImpl.java:327)
	at jdk.internal.ref.CleanerImpl.start(CleanerImpl.java:116)
	at java.lang.ref.Cleaner.create(Cleaner.java:175)
	at jdk.internal.ref.CleanerFactory.<clinit>(CleanerFactory.java:37)
	at sun.nio.fs.NativeBuffer.<init>(NativeBuffer.java:61)
	at sun.nio.fs.NativeBuffers.allocNativeBuffer(NativeBuffers.java:49)
	at sun.nio.fs.UnixNativeDispatcher.copyToNativeBuffer(UnixNativeDispatcher.java:44)
	at sun.nio.fs.UnixNativeDispatcher.stat(UnixNativeDispatcher.java:289)
	at sun.nio.fs.UnixFileAttributes.get(UnixFileAttributes.java:70)
	at sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:52)
	at sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:145)
	at sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
	at java.nio.file.Files.readAttributes(Files.java:1739)
	at java.util.zip.ZipFile$Source.get(ZipFile.java:924)
	at java.util.zip.ZipFile.<init>(ZipFile.java:213)
	at java.util.zip.ZipFile.<init>(ZipFile.java:145)
	at java.util.jar.JarFile.<init>(JarFile.java:352)
	at sun.misc.URLClassPath$JarLoader.getJarFile(URLClassPath.java:731)
	at sun.misc.URLClassPath$JarLoader.access$600(URLClassPath.java:620)
	at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:676)
	at sun.misc.URLClassPath$JarLoader$1.run(URLClassPath.java:669)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath$JarLoader.ensureOpen(URLClassPath.java:668)
	at sun.misc.URLClassPath$JarLoader.<init>(URLClassPath.java:643)
	at sun.misc.URLClassPath$3.run(URLClassPath.java:394)
	at sun.misc.URLClassPath$3.run(URLClassPath.java:380)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.misc.URLClassPath.getLoader(URLClassPath.java:379)
	at sun.misc.URLClassPath.getLoader(URLClassPath.java:356)
	at sun.misc.URLClassPath.getResource(URLClassPath.java:222)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:365)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:262)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:372)
	at java.lang.SystemClassLoaderAction.run(ClassLoader.java:2203)
	at java.lang.SystemClassLoaderAction.run(ClassLoader.java:2189)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.lang.ClassLoader.initSystemClassLoader(ClassLoader.java:1450)
	at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:1430)