Here is an excerpt from an article:
The basic concept is that the server stub class should not have to be both on the client and server. The trick is to get the server stub from the server to the client.
1. When the stub code is only on the server, the way to get it to the client is not through the rmi service, but through http. So, in order for dynamic stub loading to work, the rmi server must also be a web server.
2. The stub classes on the server must be placed where an http request can get to them. This can usually be the $HOME/public_html subdirectory (or any subdirectory therof). ($HOME means the user's home directory)
3. The server codebase must be set to the URL where the stubs where placed:
java -Djava.rmi.server.codebase=http://serverhost/~username/rmi/ ClientMain serverhost
where serverhost is the server hostname, username is the user's home directory name. In this example, the server stubs were placed in an rmi subdirectory of public_html.
The most importany point of all this is that the codebase should be set on the CLIENT java execution, not the server.
It says the URL for codebase must start with
http:// and the server must be a web server! Apparently, this is not the case for our FBN server, neither from the assignment specs nor practical implementation.
Then, what should we do? Put all the server classes in the client machine? Is this all right?
Michael