Meaningless Drivel is fun!*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes trying to start rmiregistry on a different port Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "trying to start rmiregistry on a different port" Watch "trying to start rmiregistry on a different port" New topic
Author

trying to start rmiregistry on a different port

ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Hi
I have run the following commands to first determine the active ports on my machine followed by I tried to start the RMI Server on a unused or inactive port but I am getting exception.

inside my code I start the rmiregistry as follows :
//programatically start the rmiregistry.
java.rmi.registry.LocateRegistry.createRegistry(port);
Why am I getting this exception ?
Thanks
Ravi


SCJP, SCJD, SCWCD, SCBCD, SCEA
John Smith
Ranch Hand

Joined: Oct 08, 2001
Posts: 2937

Why am I getting this exception ?

What line of code throws this exception? I suspect this happens because you use policy file and/or security manager. Try without them.
Eugene.
calvin zhu
Ranch Hand

Joined: Mar 18, 2002
Posts: 54
I have the same problem yesterday. I guess u set the port for RMI on other port beside the default 1099. (actually I can see it's 1200, just like me )
My solution was simply:
examine the Name u bound to rmiregistry,
eg:
when I have the error, my "Name" is like this:
String name = "//localhost/FBNService";
after I change to this, slove the problem. where the port is the number paramter u give.
String name = "//localhost" + ":" + port + "/FBNService";


SCEA, SCJD, SCWCD, SCBCD, SCJP<br />IBM WebSphere Portal certification
ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Thanks Calvin
I also tried the similar approach last night and it is working.
Ravi
 
GeeCON Prague 2014
 
subject: trying to start rmiregistry on a different port