I am an RMI newbie and am testing out the ComputeEngine example in the RMI trail of Sun�s Java Tutorial. I have made several modifications to the example code in conformance with the following SCJD project guidelines:
� You must not require the use of an HTTP server. � You must not require the installation of a security manager. � You must provide all classes pre-installed so that no dynamic class downloading occurs. � You must use RMI over JRMP (do not use IIOP).
I compiled the whole application using javac only (no rmic) and copied the resulting directory structure to another computer on the same network.
At this point, I did not expect the application to work propery because I had not run rmic. I decided to try it out to see what sort of errors might occur. I first tried to start the client on machine A and got a java.net.ConnectException: Connection refused. I figured that�s expected given that the server had not been started.
I then started the server on machine B. It ran without error even though I had not run rmic. I checked netstat and saw that it was listening on the port I specified.
After starting the server on machine B, I went back to machine A and ran the client again� it ran the application with expected output!
Why is my program running as an RMI application without ever compiling it using rmic? I am guessing that stubs are unnecessary as long as all of the classes are available on both client and server to prevent dynamic loading. However, it seems that many posters on this forum are using rmic despite the explicit project requirement to avoid dynamic loading. Are they taking extra steps or am I missing something? I am worried that my configuration is a special case and a similar build might flop for the exam graders�
Thanks in advance! [ April 01, 2005: Message edited by: Dan Jones ]
�This release adds support for the dynamic generation of stub classes at runtime, obviating the need to use the Java(tm) Remote Method Invocation (Java RMI) stub compiler, rmic, to pregenerate stub classes for remote objects.�
Now if only they would update the Java Tutorial... Has anyone seen any good, up-to-date RMI tutorials with examples on properly coding solutions that don�t make use of dynamic downloading? [ April 04, 2005: Message edited by: Dan Jones ]