aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI problems 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 "RMI problems" Watch "RMI problems" New topic
Author

RMI problems

Jason Ho
Greenhorn

Joined: Nov 22, 2001
Posts: 5
Hi all,
I am very new to RMI and so I downloaded the code from Sun tutorial on RMI and try it out. And I am stucked at the last part. When I run the server is give me the following error messsages :
ComputeEngine exception:access denied <java.net.SocketPermission host resolve> java.security.AccessControlException:access denied
<java.net.SocketPermission host resolve>
at java.secrity.AccessControlContext.checkPermission(Unknown Source)
at java.secrity.AccessController.checkPermission(Unknown Source)

I hope someone can help me .Thanks
Reshma Das
Ranch Hand

Joined: Jan 29, 2002
Posts: 125
try creating policy file. even iam not sure abt R MI exceptions. once i got a problem i forgot . u can read my postings from this site.
1. try creating RMIRegistry
2. put the server object to this regitry
3. create client class
HanMing Low
Ranch Hand

Joined: Oct 18, 2001
Posts: 196
Hi,
Not too sure how your code looks like.
But if you have the following line in your code.

Then, it is because the SecurityManager is denying you to access the Socket.
What you need to do is create a file named policy (or anything you like).
Add the following line to the policy file,
grant {
Permission java.security.AllPermission;
};
Then, start your application by
java -Djava.security.policy=<FullDirPath>\policy
This should make your application run.
However, granting permission to all is not recommended for production software.
So, you may wish to start your application by
java -Djava.security.policy=<dir>\policy -Djava.security.debug=access
for testing.
And you should find exactly which permission is denied and grant them accordingly using policytool.
Hope this helps.

Han Ming
Jason Ho
Greenhorn

Joined: Nov 22, 2001
Posts: 5
I solved the problem.
Thanks Reshma and HanMing.
khad M
Ranch Hand

Joined: Nov 26, 2001
Posts: 48
Originally posted by Jason Ho:
I solved the problem.
Thanks Reshma and HanMing.

..........................................
In that sun example.....
what is meant by server.
B'cas iam able to run rmiregistry.
But what ia this server and where it is?

Khad M
SCJP2.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI problems