• Post Reply Bookmark Topic Watch Topic
  • New Topic

Java RMI application on two different machines - ConnectException

 
John Went
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello. Long story short I am trying to run a client server RMI application on two different machines running Windows, but I have some trouble.

A simplified code of the server is:


And the Client:


The exception I get is: "ConnectException: Connection refused to host: 192.168.1.100; nested exception is: Connection timed out: connect".
I know this question has been asked a million times and I found out that I have to change the properties of the server and that is why I added the System.setProperty("java.rmi.server.hostname", "192.168.x.x"); line but the error remains. For the IP addres I am using the one returned from ipconfig.

I will be very thankful if someone could suggest what I can change.
 
Tony Docherty
Saloon Keeper
Posts: 3138
72
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.

Have you tried pinging from the client machine to the server to make sure there is a route to IP address 192.168.1.100 - it may be being blocked by a firewall.
 
Tony Docherty
Saloon Keeper
Posts: 3138
72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cross posted at http://stackoverflow.com/questions/27666504/running-java-rmi-application-on-two-machines-connectexception

Please BeForthrightWhenCrossPostingToOtherSites (← click). We all give up our time here for free and would rather not waste it answering a question that has already been answered elsewhere.
 
John Went
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it was because of the firewall. Thank you for the suggestion.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!