Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

transferring data through RMI

843793Feb 17 2004 — edited Sep 9 2004
I did find many posts on the subject of transferring large amounts of data through RMI methods in this forum. I didn't find a specific post concerning the exception I get when transferring data. Hence, I thought I will post this question before changing any of my implementation.

Problem: My client transfers files to the server as a single serialized object ( each object contains a byte array and the file name). This implementation seems to work fine when the client and server reside in the same machine. However, when the server is in a different machine from the client, I get the following exception when the client tries transferring large data files:
java.rmi.MarshalException: error marshalling arguments; nested exception is: \n
java.net.SocketException: Software caused connection abort: socket write error\n
at sun.rmi.server.UnicastRef.invoke(Unknown Source)\n

The above mentioned exception is NOT thrown everytime. It seems to occur more often only when multiple clients try to transfer large data at the same time. I found some posts in this forum suggesting that the java heap size should be increased; I found some which suggested to transfer data in chunks and reconstruct the data in the server. I'm not sure if increasing the heap size would solve my problem. I'm leaning towards sending data in chunks.

Question:
1. Is my assumption on heap size correct?
2. I would like to know the MAX SIZE of the byte array which can be transferred safely in a single RMI invocation.

Thanks in advance for any help.
Jawahar
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 7 2004
Added on Feb 17 2004
4 comments
1,488 views