my dog learned polymorphism*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes (B&S) Cant start RMI server on any other port except 1099 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "(B&S) Cant start RMI server on any other port except 1099" Watch "(B&S) Cant start RMI server on any other port except 1099" New topic
Author

(B&S) Cant start RMI server on any other port except 1099

Saheed Adepoju
Ranch Hand

Joined: Jun 23, 2004
Posts: 267
Hi all
I am in a dilema, i cant seem to start the RMI server on a port except that of the default RMI port and i dont seem to know why it is doing this?
An insight into the problem will highly be appreciated.Thanks.


Saheed Adepoju<br />SCJP 1.4<br />SCJD (B&S..In progress)
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
How are you trying to start the RMI registry?


42
Saheed Adepoju
Ranch Hand

Joined: Jun 23, 2004
Posts: 267
Hi all
Thanks for your reply. There is a RegContractor class that has the following method signature declared as thus:



And that is how i start the RMI registry. Thanks.I await your input.
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
That looks fine, though you may want to take into account the possibility that the registry already exists and use any running registry if available.
Saheed Adepoju
Ranch Hand

Joined: Jun 23, 2004
Posts: 267
Hi
I dont seem to understand your explanation though. I tried it on a friend's computer and it still refuses connection on any other port other than 1099. Could you please be more precised in your explanations? Thanks alot!
Oricio Ocle
Ranch Hand

Joined: Nov 30, 2004
Posts: 284

Hello Saheed,
Take a look to Naming class source code:




If no port is parsed, is set to:

As you can see in java.rmi.registry.LocateRegistry.getRegistry(String host, int port,RMIClientSocketFactory csf).
REgards


SCJP, OCMJD, OCMJEA
 
wood burning stoves
 
subject: (B&S) Cant start RMI server on any other port except 1099