Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Access Denied..not saving to text file ERROR  RSS feed

 
Sraboni
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!