java.security.AccessControlException in Applet

女生的网名这么多〃 提交于 2020-01-15 10:17:13

问题


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.

来源:https://stackoverflow.com/questions/10150930/java-security-accesscontrolexception-in-applet

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!