wood burning stoves*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes RMI conformance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "RMI conformance" Watch "RMI conformance" New topic
Author

RMI conformance

Roman Yankin
Ranch Hand

Joined: Aug 27, 2008
Posts: 47
I have a question regarding the requirement to provide all RMI classes pre-installed "so that no dynamic class downloading occurs".

Is there any way to be sure that I have provided "stub" classes for all classes I need, in other words is there any way to check that no class is being dynamically loaded?
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Hi,

I ran the rmic command with ant during my build procedure:



So, among my compile classes I had:
RemoteServicesImpl_Skel.class
RemoteServicesImpl_Stub.class

For me, having these 2 classes proves that it is not being loaded dynamically. If RMI is working without the stubs and skeletons, it must be loaded dynamically.

That is at least my understanding, anyone else is welcome to add to my reply.

Regards,
Alex
[ August 31, 2008: Message edited by: Alex Belisle Turcot ]
Gilles Marceau
Ranch Hand

Joined: Feb 17, 2007
Posts: 78
Hello Roman,

according to this : http://java.sun.com/javase/6/docs/api/java/rmi/RMISecurityManager.html, dynamic stub downloading can occur only if you
have installed a SecurityManager. Check your assignment, but is is likely that using a SecurityManager is forbidden. So, not using a SecurityManager should grant you that no dynamic downloading stub will occur.

But there is more on this, as from JDK 1.5, the RMI framework is able
in some case to generate the stubs at runtime, see :
http://java.sun.com/javase/6/docs/technotes/guides/rmi/relnotes.html
at chapter "Dynamic Generation of Stub Classes (since 5.0)".
So "no dynamic downloading" is not the same that "all RMI classes pre-installed". Use rmic on the class implementing the Remote interface,
and you'll be safe.

Gilles
[ September 02, 2008: Message edited by: Gilles Marceau ]

SCJP 1.5<br />SCJD 1.6<br />SCBCD in progress...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI conformance