Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI stub and rmi registry

 
Jair Elton
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to generate the stub using rmic, and I can't start the rmi registry programatically?

Reading the post below I was with a little of fear, I don't use the rmic and I start the rmi registry like this:

Registry registry = LocateRegistry.createRegistry(port);

I can't? I need to start rmi registry via command line?

http://www.coderanch.com/t/188775/java-developer-SCJD/certification/Building-ant
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11945
212
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jair,
  • You need to generate the stubs using rmic


  • If the stubs are not present in the classpath of the client JVM, then it will request them from the server, and the server will dynamically generate the stubs and provide them to the client. However since it is the server that is providing the stubs, you will be breaking the rule that no dynamic downloading of class files are allowed.

  • You may start the rmi registry programatically from within your server.


  • There is nothing in the instructions which forbids this.

    There is the instruction "Your programs must not require use of command line arguments other than the single mode flag". Given this, starting the RMI registry from the command line can be problematic, as your codebase will not be set, and you may need a security manager. There are ways around these two problems, but why generate more work for yourself? Since you do not get extra marks for going beyond the specifications, and the specifications allow an easy solution, go with the easy solution! Hope this helps.

    Regards, Andrew
     
    Jair Elton
    Greenhorn
    Posts: 9
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Nice!

    Thank you!
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic