Skip to main content

Occasional AccessControlException in signed applet

No replies
jabourbih
Offline
Joined: 2009-11-19
Points: 0

I have a signed applet, whose certificate has been trusted by the user. Occasionally, the applet throws an AccessControlException when checking a read PropertyPermission on user.home. The check is performed in the init() method of the applet. I must add that there are multiple instances of the applet on the page, and as the user navigates to the next page, the applets can be reloaded.

Reviewing the console log shows that the init() method is being called *before* the Plug-in has loaded the CA store:

basic: PERF: AppletExecutionRunnable - applet.init() BEGIN ; jvmLaunch dt 225032 us, pluginInit dt 1415678 us, TotalTime: 1640710 us
hwclient1111091628
[warn] unable to read user.home property, try 1
java.security.AccessControlException: access denied (java.util.PropertyPermission user.home read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at com.hw.client.util.AbstractApplet.isTrusted(AbstractApplet.java:111)
at com.hw.client.util.AbstractApplet.init(AbstractApplet.java:43)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
security: Loading Root CA certificates from C:\Program Files\Java\jre6\lib\security\cacerts
security: Loaded Root CA certificates from C:\Program Files\Java\jre6\lib\security\cacerts
security: Loading Deployment certificates from C:\Documents and Settings\karthik.mc\Application Data\Sun\Java\Deployment\security\trusted.certs
security: Loaded Deployment certificates from C:\Documents and Settings\karthik.mc\Application Data\Sun\Java\Deployment\security\trusted.certs
security: Loading certificates from Deployment session certificate store
security: Loaded certificates from Deployment session certificate store
security: Loading certificates from Internet Explorer ROOT certificate store
security: Loaded certificates from Internet Explorer ROOT certificate store

etc.

This issue occurs with the latest JVM (6u17), and is more likely to appear on a slower machine (Pentium 4). Is this a known issue in the plug-in, and is there a workaround?

Cheers