This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Distributed Java and the fly likes Access Denied..not saving to text file ERROR Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark "Access Denied..not saving to text file ERROR" Watch "Access Denied..not saving to text file ERROR" New topic
Author

Access Denied..not saving to text file ERROR

Sraboni
Greenhorn

Joined: Jan 04, 2002
Posts: 4
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

Joined: Oct 25, 2000
Posts: 7292

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 ]

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Sraboni
Greenhorn

Joined: Jan 04, 2002
Posts: 4
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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Access Denied..not saving to text file ERROR
 
Similar Threads
policy file
RMI Server written in Microsoft SDk 4 - Its Urgent
how to set security file
Send text thru Applet(at one PC) to other PC
policy file problems