Grateful if someone can help me out with your expertise on networking coz' I have not figured out what is the cause of the problem though I have already set teh RMI Security Manager. I guess something has been missing which I am not aware of. When I try instantiating a data class from within the RemoteRequest implementation class for the remote server, I get the following error: c:\src\assign\scjd\starting> java server.FBNServer suncertify\db\db.db Exception in thread "main" java.securoty.AccessControlException: access denied (java.io.FilePermission suncertify\db\db.db write) at java.security.AccessControlContext.checkPermsssion (Unknown Source) at java.security.AccessController.checkPermsssion (Unknown Source) at java.lang.SecurityManager.checkPermission (Unknown Source) at java.lang.SecurityManager.checkWrite (Unknown Source) at java.io.File.canWrite(Unknown Source)) at suncertify.db.Data.<init> (Data.java:40) at server.RemoteRequestImpl.<init> (RemoteRequestImpl.java:17) at server.FBNServer.main (FBNServer.java:23)
Rudy, As Debajyoti says a policy file is necessary where you install a Security Manager. I had found the answer to all my RMI problems in the Core Java Vol-II. Interestingly, the author opines that it setting a security manager on the Server is unnecessary. A Security Manager is useful only on the client.
Joined: Dec 27, 2000
Thank you all. I finally manage to read/write the database db.db through RMI though the client and server are on running on the same machine. I will try running the client and server on separate machines tomorrow. Afterwards, I only have the very last item to handle: concurrent access. Without any hassle, I have my policy file set to all permission like the following. Do you guys fine tune the policy file or just set it to all permission like I do?