JDK-8189212 : Exception: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.nio.fs")
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 10
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2017-10-12
  • Updated: 2017-10-19
  • Resolved: 2017-10-19
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
The following 3 tests failed in hs-nightly 2017-10-11 on all platforms. 

java/lang/Class/packageAccess/AccessCachedPkg.java
java/lang/ClassLoader/forNameLeak/ClassForNameLeak.java
java/util/logging/FileHandlerPath.java

A common part of the exception trace seems to starting at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:495)

----------System.out:(0/0)----------
----------System.err:(26/2013)----------
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.nio.fs")
	at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
	at java.base/java.security.AccessController.checkPermission(AccessController.java:895)
	at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:558)
	at java.base/java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1534)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:186)
>>> at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:495)
	at java.base/sun.nio.fs.UnixNativeDispatcher.lstat0(Native Method)
	at java.base/sun.nio.fs.UnixNativeDispatcher.lstat(UnixNativeDispatcher.java:322)
	at java.base/sun.nio.fs.UnixFileAttributes.get(UnixFileAttributes.java:72)
	at java.base/sun.nio.fs.UnixCopyFile.move(UnixCopyFile.java:419)
	at java.base/sun.nio.fs.UnixFileSystemProvider.move(UnixFileSystemProvider.java:263)
	at java.base/java.nio.file.Files.move(Files.java:1413)
	at AccessCachedPkg.move(AccessCachedPkg.java:82)
	at AccessCachedPkg.main(AccessCachedPkg.java:53)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
	at java.base/java.lang.Thread.run(Thread.java:844)

JavaTest Message: Test threw exception: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.nio.fs")
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.nio.fs")

Comments
It's a duplicate of JDK-8189193.
19-10-2017

Two other stack traces: ----------configuration:(0/0)---------- ----------System.out:(0/0)---------- ----------System.err:(28/2125)---------- java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.nio.fs") at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) at java.base/java.security.AccessController.checkPermission(AccessController.java:895) at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:558) at java.base/java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1534) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:186) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:495) at java.base/sun.nio.fs.UnixNativeDispatcher.mkdir0(Native Method) at java.base/sun.nio.fs.UnixNativeDispatcher.mkdir(UnixNativeDispatcher.java:219) at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:381) at java.base/java.nio.file.Files.createDirectory(Files.java:682) at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:789) at java.base/java.nio.file.Files.createDirectories(Files.java:735) at JarUtils.createJarFile(JarUtils.java:64) at JarUtils.createJarFile(JarUtils.java:104) at JarUtils.createJarFile(JarUtils.java:119) at ClassForNameLeak.main(ClassForNameLeak.java:84) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115) at java.base/java.lang.Thread.run(Thread.java:844) JavaTest Message: Test threw exception: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.nio.fs") JavaTest Message: shutting down test ----------System.err:(37/2885)---------- FileHandlerPath_3aaca73c-ffa6-4580-9d2f-39aff2901452.log: not found. /tmp/FileHandlerPath_3aaca73c-ffa6-4580-9d2f-39aff2901452.log: not found. FileHandlerPath_3aaca73c-ffa6-4580-9d2f-39aff2901452.log.1: not found. /tmp/FileHandlerPath_3aaca73c-ffa6-4580-9d2f-39aff2901452.log.1: not found. deleting lock file FileHandlerPath_3aaca73c-ffa6-4580-9d2f-39aff2901452.log.lck deleting lock file FileHandlerPath_3aaca73c-ffa6-4580-9d2f-39aff2901452.log.1.lck java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.nio.fs") at java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) at java.base/java.security.AccessController.checkPermission(AccessController.java:895) at java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:558) at java.base/java.lang.SecurityManager.checkPackageAccess(SecurityManager.java:1534) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:186) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:495) at java.base/sun.nio.fs.UnixNativeDispatcher.open0(Native Method) at java.base/sun.nio.fs.UnixNativeDispatcher.open(UnixNativeDispatcher.java:71) at java.base/sun.nio.fs.UnixChannelFactory.open(UnixChannelFactory.java:257) at java.base/sun.nio.fs.UnixChannelFactory.newFileChannel(UnixChannelFactory.java:136) at java.base/sun.nio.fs.UnixChannelFactory.newFileChannel(UnixChannelFactory.java:148) at java.base/sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:176) at java.base/java.nio.channels.FileChannel.open(FileChannel.java:292) at java.base/java.nio.channels.FileChannel.open(FileChannel.java:340) at java.logging/java.util.logging.FileHandler.openFiles(FileHandler.java:511) at java.logging/java.util.logging.FileHandler.(FileHandler.java:278) at FileHandlerPath.test(FileHandlerPath.java:236) at FileHandlerPath$TestCase.run(FileHandlerPath.java:74) at FileHandlerPath.main(FileHandlerPath.java:146) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:564) at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115) at java.base/java.lang.Thread.run(Thread.java:844) JavaTest Message: Test threw exception: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.nio.fs") JavaTest Message: shutting down test
12-10-2017