How to solve java.security.AccessControlException?

Hamit Ocak picture Hamit Ocak · Feb 1, 2013 · Viewed 31.1k times · Source

I am trying to access client's temp directory through my applet on my web project.
When I run the applet by itself, it gets the tempdir with no problem.

When I try to get it on my project using javascript and calling the applet method, I am having accessControlException on my javascript console. Also I am getting the same exception when I try to read a file under the temp directory.

This is what I see exactly:

java.security.accesscontrolexception access denied (java.util.propertypermission java.io.tmpdir read)
java.security.accesscontrolexception access denied (java.io.filepermission read)

How to solve java.security.AccessControlException?

Answer

user207421 picture user207421 · Feb 1, 2013

Simplest solution is just to sign the applet.