File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

trying to start rmiregistry on a different port

 
ravi janap
Ranch Hand
Posts: 389
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
John Smith
Ranch Hand
Posts: 2937
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 54
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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";
 
ravi janap
Ranch Hand
Posts: 389
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Calvin
I also tried the similar approach last night and it is working.
Ravi
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic