Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

AccessContralException  RSS feed

 
kirba devi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
when i trying to read a file ,showing java.security.AccessControlException:access denied (java.io.FilePermission D:\somefilename


Regards
Kirba
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That means a SecurityManager is active which does not allow access. What kind of code is this - an applet, servlet, application, ...?

Does the account under which the code is run have permission to access that file?
 
kirba devi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its an application.i am trying to read from the folder say for example D:\Images

At runtime without -Djava.security.manager giving java.security.AccessControlException(java.io.FilePermission D:\Images read)
eg java "-Djava.security.manager" classname

By setting my own java.policy ie -Djava.security.manager -Djava.security.policy=myjava.policy
Still problem arises

Regards
Kirba
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!