Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Wrestling with access control security

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have an applet that calls a bunch of pojos to eventually read in image files and display them. I had everything working on my old machine but rebuild when my hard drive went bad, and I cannot remember how to get around the access control to read a file on the local machine. Even though I have self-signed the .jar file, I keep getting a java.security.AccessControlException: access denied ("java.io.FilePermission"... error. I believe the self-signing works because if I use the .jar file before I sign it I get a different error (java.security.AccessControlException: access denied ("java.util.PropertyPermission" "com.sun.media.jai.disableMediaLib" "write")). The jarfile contains a policy file granting all permissions in its root, but at this point I can't even remember if I was using a policy file before or not.

I checked out https://coderanch.com/how-to/java/HowCanAnAppletReadFilesOnTheLocalFileSystem on here, but it says that if a jar file is signed then it should have full permissions. What am I doing wrong here?

Would someone kindly point me in the right direction?

Thanks!
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

J Ellis wrote:Hi all,

I have an applet that calls a bunch of pojos to eventually read in image files and display them. I had everything working on my old machine but rebuild when my hard drive went bad, and I cannot remember how to get around the access control to read a file on the local machine. Even though I have self-signed the .jar file, I keep getting a java.security.AccessControlException: access denied ("java.io.FilePermission"... error. I believe the self-signing works because if I use the .jar file before I sign it I get a different error (java.security.AccessControlException: access denied ("java.util.PropertyPermission" "com.sun.media.jai.disableMediaLib" "write")). The jarfile contains a policy file granting all permissions in its root, but at this point I can't even remember if I was using a policy file before or not.

I checked out https://coderanch.com/how-to/java/HowCanAnAppletReadFilesOnTheLocalFileSystem on here, but it says that if a jar file is signed then it should have full permissions. What am I doing wrong here?

Would someone kindly point me in the right direction?

Thanks!



Do you create a new SecurityManager in your applet? I got the similar problem and solved it by setting the security manager to null.
 
I love a good mentalist. And so does this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic