• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • 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 ]
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic