Hello,
I have run such a configuration of example RMI application:
Host1:
server.jar - it server application
http://host1.local/classes/library.jar - interface of remote object
Host2:
client.jar - client application
Server runs properly only with such options:
java -cp d:\interface\library.jar;d:\server\server.jar -Djava.rmi.server.codebase=http://host1/classes/library.jar -Djava.security.policy=d:\server\server.policy app.Server
And client with following options (on another host - host2):
java -cp c:\interface\library.jar;c:\client\client.jar -Djava.security.policy=c:\client\client.policy app.Client
With other combinations of options it simply doesn't work.
And now my question:
In Sun's documentation in the codebase folder should be REMOTE OBJECT STUB, but interface IS NOT a stub. So why my example works?
And the next question: since Java 1.5 using rmic to generate remote object stub is no longer needed, so what for is the codebase?
I thought that client can download interface definition from remote server, however it's not true as well. Interface have to be in client classpath.
Remove of codebase option from server causes rise of unmarshall exception.
Can somebody explain me that all?
Regards,
Wojtek