This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Security & Policy file

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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";
}
 
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic