aspose file tools*
The moose likes Distributed Java and the fly likes RMI passing objects with ArrayLists of objects as their members. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "RMI passing objects with ArrayLists of objects as their members." Watch "RMI passing objects with ArrayLists of objects as their members." New topic
Author

RMI passing objects with ArrayLists of objects as their members.

Julio Compadre
Greenhorn

Joined: Sep 14, 2007
Posts: 10
Hi,

I have made a RMI server and client Software that works if the one calls remote methods that have as parameters simple Objects.
More precisely: by simple objects I mean the parameters passed to the remote methods are made of classes where the members are all simple primitive data types.

for example:



In my case telt is an instance of the following object:




When there is no ArrayList of otherObj , the tubtel, the rmi invocation works fine! Data is passed correctly and the results are returned ok.

But I always get a unmarshalling error when I pass the above Object to the remote method with the ArrayList of otherObj.
I tested the same call Without the tubtel Arraylist and there was no error ?!

Can someone explain how to make such a remote method invocation when your method parameters have Objcets that contain member that are ArrayList of other Objects ?


Regards

Java Rules!!!
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Posts: 1638

It is generally better to TellTheDetails. It will help if you post the exception details here.

Is your "otherObj" serializable?

Do you have the serialized object definitions in the client side or have enabled dynamic class downloading?


apigee, a better way to API!
Julio Compadre
Greenhorn

Joined: Sep 14, 2007
Posts: 10
Hi,

Nitesh Kant wrote:It is generally better to TellTheDetails. It will help if you post the exception details here.

Is your "otherObj" serializable?

Do you have the serialized object definitions in the client side or have enabled dynamic class downloading?


You are absolutely right Nitesh, sorry for not showing the log ...
Also sorry as I could not reply yesterday.

Watching the logs showed me exactly the problem: The otherObj was not Serializable indeed !
the logs showed a clear:



For not only otherObj but also some other classes inside my App that where used latter!
I could get it to work easily by making those classes implement Serializable.
I got another error latter because one of Classes I used did implement serializable but I forgot to add a static field with a :



field.

After adding this field I could pass the correct Object with the ArrayList of otherObj as a parameter.

Regards
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RMI passing objects with ArrayLists of objects as their members.