This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Applets and the fly likes AccessControlException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "AccessControlException" Watch "AccessControlException" New topic
Author

AccessControlException

sree visu
Ranch Hand

Joined: Jul 05, 2007
Posts: 133

I tried to read the documentation given by sun but it said that we must configure the java.policy file.

Could anyone say where to configure it and where is that available.
Also please do give me an example of how to do it for a particular applet that is handling it

it gives the following exception



please do say me how to add the permission to my local machine the particular java.policy file and where to add it[/CODE]

Thanks for your reply in advance


Regards<br />Sree Visu<br />SCJP 5.0, SCWCD 5.0, SCJD(Preparing B&S 2.2.2)
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41180
    
  45
The HowCanAnAppletReadFilesOnTheLocalFileSystem page talks about that. It also mentions signing the applet, which is an alternative to changing the security policy.


Ping & DNS - my free Android networking tools app
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 685
Here's a bit of my .java.policy file.There is a Sun program: policytool that provides a GUI to update it. Sometimes it doesn't work, so I often update it with an editor. On my Windows XP, the file is in C:\Documents and Settings


grant codeBase "File:/D:/JavaDevelopment/Testing/-" {
permission java.io.FilePermission "<<ALL FILES>>", "read,write,execute";
permission java.lang.RuntimePermission "accessClassInPackage.sun.net.www.protocol.file";
permission java.lang.RuntimePermission "setFactory";
};
 
wood burning stoves
 
subject: AccessControlException
 
Similar Threads
file reading in applet
rmi policy file
unexpected exception:please help
applet security exception,
AccessControlException