This week's book giveaway is in the Cloud/Virtualization forum. We're giving away four copies of Mastering Corda: Blockchain for Java Developers and have Jamiel Sheikh on-line! See this thread for details.
I must have read these through the specs a million times : "If the business method corresponds to a method of the entity bean�s REMOTE interface, the method argument and return value types MUST be legal types for RMI-IIOP."
What are examples of legal and illegal RMI IIOP types? I read in HFEJB they should be one of the following: - Primitives - Serializable Objects - Array or collections of primitives or serializable objects. - A remote object
Now what would be an illegal type? let me guess: Boolean, Integer wrapper types?
The same goes for serializable objects. Which objects are serializable and which are not? HFEJB mentions that String is not serializable. What other illegal types? Why is string considered non serializable?
>>What are examples of legal and illegal RMI IIOP types? I read in HFEJB >>they >>should be one of the following: >>- Primitives >>- Serializable Objects >>- Array or collections of primitives or serializable objects. >>- A remote object >> >>Now what would be an illegal type? let me guess: Boolean, Integer wrapper >>types?
Illegal types are the objects that do not fit to any of the rules you enumerated Strings, boolean, integer and all Wrapper types ARE serializable objects, because they implement the Serializable marker interface (check the J2SDK doc for each class). You define a serializable class when it implements the Serializable marker interface (yes, it's that simple), and its attributes must be serializable, too. Some classes that are not serializable: java.net.Socket, java.sql.DriverManager. They're not either RMI-IIOP compliant objects. That's my R$0.02.
"In the case of a nuclear attack, the protection of our records is essential, if this country is to carry on its economy and maintain our way of life."
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
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.