• 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, maybe a bit offtopic ?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Running RMI server and client on same host works fine.

When starting my RMI server the java code:
InetAddress.getLocalHost().getHostAddress() - returns 127.0.0.1 but I need the public LAN ip adress: 192.168.0.100 (My linuxserver)

Can solve this with -Djava.rmi.server.host=192.168.0.100 when starting the server but no -D parmeters is allowed in SCJD.

How to configure this on linux

/etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.0.100 ???

BR
 
Ranch Hand
Posts: 961
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not sure to understand your question. All I can tell you is that when your client needs to connect to your server you can use Locate.getRegistry(String host, int port) to get access to the RMI registry running on your server.

Here is where you have to provide the IP address of the machine where the RMI server is running. And that should suffice to your intentions.

Does this help anyhow?
 
Jorgen Sandstrom
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the reply.

It's a linux config problem (FC5)

Orginal /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost

Hacked /etc/hosts (Linux has now the static ip 192.168.0.100)
# Do not remove the following line, or various programs
# that require network functionality will fail.
#127.0.0.1 localhost.localdomain localhost
192.168.0.100 localhost.localdomain localhost

Getting the server ip from javacode (when starting rmi server)
InetAddress.getLocalHost().getHostAddress() - Now gives me the wanted ip 192.168.0.100 and the windows client can log on and perform remote method calls...jippie.

If anyone nowes how to configure (in a proper way) this without unmark loopback 127.0.0.1 I would be happy.

Late friday afternoon here in sweden, time for somthing good to eat...and drink.

BR
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic