• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI stub and rmi registry

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?

https://coderanch.com/t/188775/java-developer-SCJD/certification/Building-ant
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Nice!

    Thank you!
     
    Consider Paul's rocket mass heater.
    reply
      Bookmark Topic Watch Topic
    • New Topic