File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Help on remote connection error" Watch "Help on remote connection error" New topic

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
Exception in thread "main" java.securoty.AccessControlException: access denied ( suncertify\db\db.db write)
at (Unknown Source)
at (Unknown Source)
at java.lang.SecurityManager.checkPermission (Unknown Source)
at java.lang.SecurityManager.checkWrite (Unknown Source)
at Source))
at suncertify.db.Data.<init> (
at server.RemoteRequestImpl.<init> (
at server.FBNServer.main (

Debajyoti Pathak
Ranch Hand

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

Joined: Sep 30, 2000
Posts: 324
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:
subject: Help on remote connection error
It's not a secret anymore!