• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: RMI registry port ConnectException if not on 1099

 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • 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.
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
Leo Tien
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic