java.security.AccessControlException
I have an applet that I self-signed (following those 10 steps to sign an applet), which access a MySQL database. Unfortuneatly , it is giving me an error:
The SQLException: Unable to connect to any hosts due to exception: java.security.AccessControlException: access denied (java.util.PropertyPermission file.encoding read)
I assumed that signing the applet would take care of all the security issues. The certificate I'd created is linked on the page. and IE (or the java plug-in) pops up a window asking me to install the certificate.What am I doing wrong? I dont want to have to have users modify their policy file to run the applet.
-tblank
[684 byte] By [
tblank] at [2007-9-30 11:25:04]

Well, without a complite trace it would be only guessing but I think you should read this:
http://forum.java.sun.com/thread.jsp?forum=63&thread=524815
second post
The above link explains that methods called from javascript are never allowed, in reality no method can do
"privileged" tasks unless the whole stack (method that called the method that called the method that ...) is
allowed to do so.
And/or provide a full trace (minimum the full stack trace):
To turn the full trace on you can start the java console, to be found here:
C:\Program Files\Java\j2re1.4...\bin\jpicpl32.exe
In the advanced tab you can fill in something for runtime parameters fill in this:
-Djavaplugin.trace=true -Djavaplugin.trace.option=basic|net|security|ext|liveconnect
The trace is here:
C:\Documents and Settings\your user\Application Data\Sun\Java\Deployment\log\plugin...log
Hi,
I run into the same problem. I am assuming hava a self-signed applet will do the trick; but that was not the case. The only way I can get it working now is to use the policy file. Am I right to assuming that ? I really could not find any straight forward answer on this. Every example I found in SUN were talking about signing the applet and using policy file together. Why ?
Am I doing some wrong signing the applet ? All I did is generate a key and import that to the client machine. The strange thing is, I don't think that actually make any different. The certificate still popup with or without importing the key (there is a warning on untrusted issuer). I am using default keystore to do that; but I don't think that make any different, does it ?
Anyway, hope somebody will answer my question here.
thanks