Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.rmi.ConnectException

 
preveeth ott
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
Hope u all r enjoying ur life to the fullest. i am a little new to rmi. i've been working with a few example. it is working fine when i am using the 'rmiregistry' utility. but when i am creating a registry reference using
LocateRegistry.getRegistry("localhost",1099);
though the server is running fine, when the client uses lookup() to get the RemoteInterface, i am getting the following exception
"java.rmi.ConnectException: Connection refused to host: localhost; nested exception is:
java.net.ConnectException: Connection refused: connect"
the server uses the rebind() of Registry class and not the Naming class....is that the problem
it would be great if i could get some help from u brainy guys.
Thanx for taking the time to go thru the problem.
 
raimondas zemaitis
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only reason for this is that RMI registry is inaccessible. It is either not running or running on another port. What I don't like about RMI registry is when you try to get registry you just get it no matter if it is OK or not (i.e you get registry stub in any case), however the only way to check if it's OK is to ping it using list() for example. I'd like there to be some check method, say boolean isRunning().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic