This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
The location where Pi class is available is set using the -Djava.rmi.server.codebase=file:/c:/home/jones/public_html/classes/ command line arg on client side.
When the remote method is called, server finds that it doesn't know the class Pi whose instance is sent by this client. So the RMI infrastructure loads the classes from the codebase specified by the same client. If another client sends a class Pi2 with a different codebase, the server side will load Pi2 from the second codebase. Each client can specify its own codebase. The server also can specify its own codebase to serve classes required by clients.
A great way to understand what's going on in the RMI infrastructure on server side, client side and in registry is
- start all of them with the command line arg -Djava.util.logging.config.file=rmilogging.properties
- Create this file "rmilogging.properties" in the same directory with the following contents: