• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

RMI UnknownHostException Problem

 
Greenhorn
Posts: 3
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am having trouble with a Java RMI system that I am building. I keep getting an UnknownHostException when I try to connect. For host names, I've tried my IPv4 address, IPv6 address, "localhost", some other things, and more. I also tried typing in random words to see if there was a difference. There wasn't; I got exactly the same error. Here's some code:

The main client-side class:


The Client Network IO Class:


The Server-Side Network IO Class:


The Remote Interface:


The Remote Implementation:

The error message (EvansGame is the name of my computer, but the error is the same no matter what I type. I could type "foo bar" and nothing would change):


The WebConstants Class (Accessed by both Client and Server):


I don't have much knowledge of networking or RMI, so I really don't understand why this is happening.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try having your SERVICE_NAME one word instead of 2.
 
Joshua Evans
Greenhorn
Posts: 3
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Didn't work.
 
K. Tsang
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What IP address did you use to start the RMI server? localhost or 127.0.0.1 or something else. It should work for 127.0.0.1 if client and server are on same computer. The other 2 may need to put entry in HOSTS file.
 
Joshua Evans
Greenhorn
Posts: 3
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had already tried those, but I tried them again for sure, and... still didn't work. As I said, the error is the same no matter what I type in.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic