This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

NX: RMI registry port ConnectException if not on 1099

 
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All works perfectly if I use port 1099.
But when I specify another port like:

// Start up a RMI registry.
LocateRegistry.createRegistry(1098);

I get a java.rmi.ConnectException.
Why? Are there only some ports that are valid for RMI?
I have tried a whole lot and havn't found another one that works.
 
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jacques,

Originally posted by Jacques Bosch:
All works perfectly if I use port 1099.
But when I specify another port like:

// Start up a RMI registry.
LocateRegistry.createRegistry(1098);

I get a java.rmi.ConnectException.
Why?


Check out the Java API for LocateRegistry.createRegistry and you'll see that it returns a Registry object. The Registry object returned is the registry that you need to reference from then on. For example:

Hope this helps,
George
 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
George. You are a cool dude.
Thanx. That sorted it. (Yeah, I didn't read the API very much - sorry).
J
 
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jacques:
Can you statement your problem detailly ? Because in my test, this two way all work fine.
one:
Registry registry = LocateRegistry.createRegistry(1234);
registry.rebind(xxxxx, xxxxx);
two:
LocateRegistry.createRegistry(1234);
Naming.rebind(xxxxx, xxxxx);
 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Leo.


two:
LocateRegistry.createRegistry(1234);
Naming.rebind(xxxxx, xxxxx);


Well, that only worked for me on port 1099. When using a different port, I got the exception I posted previously.
The first one works fine for me though.
 
Leo Tien
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Jacques:
My test evn is JBuilder 9 + windows 2000, I use this way run the server successfully, in the client I get a Exception, but isn't the connect problem, did you find the answer of your problem???
Thanks.
[ February 04, 2004: Message edited by: Leo Tien ]
 
Or we might never have existed at all. Freaky. So we should cherish everything. Even this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic