1

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.
Roman C
  • 49,761
  • 33
  • 66
  • 176
TU_HEO DAKAI
  • 2,197
  • 8
  • 28
  • 39
  • 1
    Are you prompted to accept the digitally signed code when the applet is loaded by the browser? The policy files will not be useful at time of deployment. – Andrew Thompson Apr 14 '12 at 05:41
  • @AndrewThompson: Yes, the browser asked me whether block the applet from being run or not.. Due to Andih'd advice, the applet is now runnable in appletviewer, but in browser, it doesn't work.. – TU_HEO DAKAI Apr 14 '12 at 06:01

0 Answers0