*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Help on remote connection error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Help on remote connection error" Watch "Help on remote connection error" New topic
Author

Help on remote connection error

Rudy Yeung
Ranch Hand

Joined: Dec 27, 2000
Posts: 183
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)


Debajyoti Pathak
Ranch Hand

Joined: Dec 18, 2000
Posts: 39
Rudy,
since you are using a security manager you need to use a policy file wherin you have to specify read write permission for files.
Deb
Rahul Rathore
Ranch Hand

Joined: Sep 30, 2000
Posts: 324
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.
Rudy Yeung
Ranch Hand

Joined: Dec 27, 2000
Posts: 183
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?

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help on remote connection error