JDK-6995087 : JDK7 :java.security.AccessControlException is getting thrown on reloading some applets
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u23,7
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: windows,windows_7
  • CPU: generic,x86
  • Submitted: 2010-10-26
  • Updated: 2013-09-12
  • Resolved: 2011-05-31
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 7
7 b138Fixed
Related Reports
Relates :  
Description
Some applets are getting loaded fine intially but end up throwing securiyt exception on doing a page relaod. 
Try to load following applets inside the browser.
http://sqeweb.sfbay.sun.com/deployment2/jitu/plug-bug/security/eventqueue/ToolKitEventQueueACTest.html
http://sqeweb.sfbay.sun.com/deployment2/jitu/plug-bug/security/eventqueue/ToolKitEventQueueACTest2.html
try to do page reload and if following exceptions are getting thrown then bug is reproduced
java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at sun.plugin2.applet.Applet2SecurityManager.checkAccess(Unknown Source)
	at java.lang.ThreadGroup.checkAccess(Unknown Source)
	at java.lang.Thread.init(Unknown Source)
	at java.lang.Thread.<init>(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.beginPainting(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager.setupGrayBoxPainter(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager.access$600(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Exception: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThreadGroup")
PluginMain.StartAppletListener: appletErrorOccurred for applet ID 10
Exception in thread "thread applet-EventQueueKeyStrokeTest.class-10" java.lang.ExceptionInInitializerError
	at sun.plugin.services.WIExplorerBrowserService.getBrowserSigningRootCertStore(Unknown Source)
	at sun.plugin2.main.client.WIExplorerServiceDelegate.getBrowserSigningRootCertStore(Unknown Source)
	at sun.plugin2.main.client.MessagePassingExecutionContext.getBrowserSigningRootCertStore(Unknown Source)
	at sun.plugin2.applet.Applet2BrowserService.getBrowserSigningRootCertStore(Unknown Source)
	at com.sun.deploy.security.TrustDecider.reset(Unknown Source)
	at com.sun.deploy.security.TrustDecider.<clinit>(Unknown Source)
	at sun.plugin.util.ErrorPanel.deniedCertificateFailure(Unknown Source)
	at sun.plugin.util.ErrorPanel.<init>(Unknown Source)
	at sun.plugin.util.GrayBoxPanel.setError(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.getGrayBoxPanel(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.paintGrayBox(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.repaintGrayBox(Unknown Source)
	at sun.plugin.util.GrayBoxPainter.showLoadingError(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager.showAppletException(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager.showAppletException(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "C:\Program Files\Java\jre7\bin\msvcr100.dll" "read")
	at java.security.AccessControlContext.checkPermission(Unknown Source)
	at java.security.AccessController.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkPermission(Unknown Source)
	at java.lang.SecurityManager.checkRead(Unknown Source)
	at java.io.File.exists(Unknown Source)
	at com.sun.deploy.config.WinPlatform.loadDeployNativeLib(Unknown Source)
	at com.sun.deploy.security.WIExplorerCertStore.<clinit>(Unknown Source)
	... 17 more

Comments
EVALUATION from Thread API, "when Thread is constructed with 3 args, securityManager's checkPermission method is called with the RuntimePermission("enableContextClassLoaderOverride") permission when invoked directly or indirectly by the constructor of a subclass which overrides the getContextClassLoader or setContextClassLoader methods. This may result in a SecurityException." This potentially is the root cause of AccessControlException we have in this bug. We should put constructor into doPrivileged block if we'll setContextClassLoader right after.
07-04-2011

PUBLIC COMMENTS Issue is also reproducible with 6u23
27-10-2010