This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Applets and the fly likes Applet  AccessControlException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet  AccessControlException" Watch "Applet  AccessControlException" New topic
Author

Applet AccessControlException

Kedar Dravid
Ranch Hand

Joined: May 28, 2004
Posts: 333
I am trying to store a file on the server. I am using an applet to capture video streams from a web-cam and store the files on the server every 10 minutes. But I am getting the following exception:
java.security.AccessControlException: access denied (java.io.FilePermission C:\temp read)
I created a policy file


I also enabled the option for allowing aplets to write to a file in the JMF Registry. But the exception still remains.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41015
    
  43

I created a policy file


Then it looks like you're not done with it yet :-)

I think the contents of the policy file matter more than the code of the applet; why don't you post what your have so far so we can take a look at it.


Ping & DNS - my free Android networking tools app
Kedar Dravid
Ranch Hand

Joined: May 28, 2004
Posts: 333
Here's the content of my .java.policy file stored in my home folder:
grant { permission java.io.FilePermission "C:\\temp\\*", "read,write"; };
Also, to be doubly sure, I added the following lines to the default security policy file in <JAVA_HOME>/jre/lib/security.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41015
    
  43
Could it be that the JVM used by the browser is a different one than the one in JAVA_HOME? In that case it would have its own directories somewhere.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Applet AccessControlException
 
Similar Threads
Help Regarding Delay in Voice Conversation
Java Media Framework - How to capture screen activity?
Need help writing non-gui JMF program
audio device not detected in windows 7 64bit OS using JMF
Help with voice chat using JMF