• 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

RMI

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm new to RMI and I'm trying to implement it for a small game; however when I try to run it, it doesn't work and I've spent a lot of time to understand why, but I still haven't figured it out. Maybe some of you have something similar happened to them

This is the client:



this is the server:




and this is the error that it's showed when I try to run it


 
Saloon Keeper
Posts: 27819
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try defining "HOST" as "localhost" instead of as "127.0.0.1".

Also check to make sure that you don't have a firewall blocking RMI calls. The "netstat" command can be used to determine if your RMI server is running properly.
 
virginia pi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Changing "127.0.0.1" into "localhost" worked! Thank you for your help
 
Tim Holloway
Saloon Keeper
Posts: 27819
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The documentation was imprecise. Where it said "host", it should properly have said "(resolvable) hostname".

The getRegistry was attempting to locate a host with the name of "127.0.0.1" instead of the address of 127.0.0.1, so it failed.

Apparently there's no getResistry call for an IP address, but if you don't supply any arguments, localhost is the default.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic