java.security.AccessControlException in Applet

TU_HEO DAKAI picture TU_HEO DAKAI · Apr 14, 2012 · Viewed 12.1k times · Source

Inside my Applet, it needs to download the csv file from other site to run.

When i run applet with appletviewer, it gave me this exception :

java.security.AccessControlException: access denied (java.net.SocketPermision www.xxxsitexxx.com:80 connect, resolve
   ....

My applet's signed :

 jarsigner -verify myfile.jar >> the result :  jar verified.

I tried to add :

grant {
      permission java.security.AllPermission;
    };

into Tomcat's folder :

..conf/catalina.policy

But it didn't work.

Google suggests me to add security permisson to :

... jre/lib/security/java.policy

But I couldn't change it :

Access to ... jre/lib/security/java.policy was denied.

My question is :

  1. Does add permission to java.policy solve to problem?
  2. If so, how could I change java.policy's content?

PS : I read many questions here relate to my problem in Stackoverflow, but I couldn't find the right way to solve it.

EDIT : i got the Applet work by signing all jar files that needed to run with the Applet.

Answer