posted 20 years ago
I'm thinking about is it a good approach to require manual starting of RMI registry with classpath set to runme.jar before starting of the server?
I know - there are alternative approaches, like creating of registry on application startup by means of LocateRegistry.createRegistry or specifying the system property: java.rmi.server.codebase=<path to server classes>, but to my oppinion those ways have serious drawbacks:
- LocateRegistry.createRegistry - it does not allow to place RMI registry on remote machine.
- java.rmi.server.codebase property - this approach contradicts with the requirement - "You must provide all classes pre-installed so that no dynamic class downloading occurs". The server still can be run this way if the user who starts the server specify this property in command
line using -D key of JVM, however, this approach voilates another requirement - "Your programs must not require use of command line arguments other than the single mode flag".
It is possible to combine those approach, e.g. check if the RMI registry is available and start it in case of its absence by LocateRegistry.createRegistry, but such a solution
will add superfluous complexity to the entire project.
I want your judgement on my decision to require manual starting of rmiregistry with properly set classpath.