This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

NX: RMI registry port ConnectException if not on 1099  RSS feed

 
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.
 
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
 
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
Boost this thread!