aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Security & Policy file Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Security & Policy file" Watch "Security & Policy file" New topic
Author

Security & Policy file

Michael Nadel
Greenhorn

Joined: May 21, 2001
Posts: 4
When I run my client on one machine, and the server on another, I get the following on the client error every time I try communicating with the server via RMI:
java.rmi.ConnectException: Connection refused to host: 127.0.0.1
This looks like a different error than the usual message received when the policy file is set up incorrectly.
Any ideas?
TIA,
michael
My policy file is:
grant {
permission java.security.AllPermission;
permission java.net.SocketPermission "*:1024-65535", "connect,accept,resolve";
permission java.net.SocketPermission "*:1-1023", "connect,resolve";
}
Trevor Dunn
Ranch Hand

Joined: Jun 13, 2001
Posts: 84
Hi,
I just struggled with a ConnectException. In research I found that there is a common bug in RMI that has something to do with not being able to resolve the host name. One of the solutions was to provide the command line argument
-Djava.rmi.hostname=hostname
I am not sure if this is your problem. As it turned out it was not my problem. The one I had was that I was calling LocateRegistry.getRegistry(name, port) to see if an instance of the registry was already running. As it turns out, even if there is not a registry running this call returns a Registry object anyway that does not work.
I hope this helps
Trevor
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Security & Policy file
 
Similar Threads
security manager
RMI Server Connection Problem on XP prof
policy file problems
Too minimalistic policy files?
is this security ok?