Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Applet AccessControlException

 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


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.
 
Kedar Dravid
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
I do some of my very best work in water. Like this tiny ad:
Garden Master Course kickstarter
https://coderanch.com/t/754577/Garden-Master-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic