• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Java RMI application on two different machines - ConnectException

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Bartender
Posts: 3323
86
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Bartender
Posts: 3323
86
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, it was because of the firewall. Thank you for the suggestion.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic