• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Connection Exception with RMI

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ,
I have written a simple "HelloWorld", using RMI. The program works fine when in run both client and server on the same machine.
But when i run client on a different machine, i get connectionException.
I have checked the policy file and that seems to be ok, i mean no restriction.
Serverside rebind code:
LocateRegistry.createRegistry(2002);
Registry registry = LocateRegistry.getRegistry(2002);
registry.rebind("Hello", obj);
System.out.println("HelloImpl bound in registry");
client side look-up code:
Registry registry = LocateRegistry.getRegistry(2002);
Hello obj = (Hello)registry.lookup("//134.168.56.47:2002"+"/Hello");
String message = obj.sayHello();
System.out.println(message);
Can some one tell me what i am doing wrong ?
TIA
praveen.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the RMI forum (Distributed Java).
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This could not a security exception, so you don't have to make changes in the policy file.
Did you try using the machine name (DNS name)instead of the ip address, when you look up for the remote interface.
Let me know if you fix it and also how you fixed it.
 
Sunglasses. AKA Coolness prosthetic. This tiny ad doesn't need shades:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic