• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Access Denied..not saving to text file ERROR

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I m working on this RMI project, where the client sends this object(it is a string) to the server and the server is suppose to save it into a text file. my interface and all the client and server programs compile and run. I can send the object from the client side to the server side, and the server receives it successfully as well, but when it comes to saving it to the text file i get an error saying
Java.permission: access denied to the text file.
I have never used rmi to save an object to a text file, and i dont know why this might be happening. Can anyone help?
Thanks
Sraboni
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It depends to some degree how the write is being performed. If you are receiving on object from the client, then you may not have the correct policy to allow this write operation.
Try adding this to the policy file on the server side:

Please take a moment to read our policy on login names. We ask that you provide first and last name when registering on the site. We feel this gives JavaRanch a more professional appearance, and helps to promote its use. Thanks!
[ January 05, 2002: Message edited by: Michael Ernest ]
 
Sraboni
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you Micheal
Can I simply just add that bit of code into the java.policy file or do i have to put it after a certain line of code within the policy file?
I tried using that but i still get the same error.
I m sending an object, there possibly couldnt be any error when i m using Objectinputstream and ObjectOutputstream..could there be any error? i wouldnt think so cause the server does receive the object, it when it comes to saving.
Anything else you might suggest?
Please can you also let me know how i would be able to change my displayed name, as i tried, but i dont think i will be able to..would i?
Thanks,
Sultana Idris
 
Message for you sir! I think it is a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic