What are the legal RMI types refered to by the J2EE Developer's Guide? As one of the method requirements, it often says, "The arguments and return type must be legal types for Java RMI."

Ashley Tate

A legal value type for RMI is an object that implements the java.io.Serializable interface and is, in fact, serializable (An object that implements the Serializable interface will not actually be serializable if the classes of one or more of its member variables are non-serializable).

Interestingly, it is a violation of the J2EE specification to pass or return a parameter of type java.lang.Object from an EJB method because the Object class does not implement Serializable. Some EJB 1.1 compliant application servers (the J2EE reference server itself for example!) will allow the deployment and use of EJB's that violate this constraint if at runtime the bean methods actually pass and return sub-types of Object that are serializable. However, if you run the Verifier tool that comes with the J2EE reference server, you will be informed that the bean method parameters do not conform to the RMI-IIOP value type guidelines.

For a more detailed explanation of legal RMI types, read section 2.6 of the RMI specification at: http://java.sun.com/j2se/1.3/docs/guide/rmi/spec/rmiTOC.html

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact