AccessControlException when Applet tries to access java.io.tmpdir

1.9k Views Asked by At

I have a signed Applet that loads images. Applet has background threads retrieving images from server. Initially Applet loads images with no problem, but after loading about 7 images I'm getting below error:

java.security.AccessControlException: access denied ("java.util.PropertyPermission" "java.io.tmpdir" "read")
    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.AWTAppletSecurityManager.checkPermission(Unknown Source)
    at java.lang.SecurityManager.checkPropertyAccess(Unknown Source)
    at java.lang.System.getProperty(Unknown Source)

It is throwing error when doing this

System.getProperty("java.io.tmpdir")

But like I said initially I'm able to read thatt system property, but then all the sudden stops working.

Anyone know why this could happen? Could other Applet background threads be locking reading that system property? Because of this, javax.imageio.ImageIO.read will eventually throw error, since it can't access the system property.

Thanks in advance!

0

There are 0 best solutions below