File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Distributed Java and the fly likes Error returning object from Remote method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "Error returning object from Remote method" Watch "Error returning object from Remote method" New topic
Author

Error returning object from Remote method

naveen chinthakunta
Greenhorn

Joined: Sep 26, 2005
Posts: 16
Hi all,

I am trying to pass a string to a remote method and return an object of a user defined class. In the process i am getting the following error.

==========================================================================
Exception in thread "main" java.rmi.RemoteException: call return failed: ; nested exception is:
java.io.WriteAbortedException: Exception thrown during writing of stream; java.io.NotSerializableException: drac.TNAClass

==========================================================================

could u tell me where i am going wrong? also is this allowed in RMI? If not, whats the work around?

Thanks in advance.

navEEn
Edward Harned
Ranch Hand

Joined: Sep 19, 2005
Posts: 291

The message says it all:
java.io.NotSerializableException

Any Class you wish to pass to or from an RMI Server must implement the Serializable interface.

There are many examples of how to do this in the tutorials.


Ed's latest article: A Java Parallel Calamity http://coopsoft.com/ar/Calamity2Article.html
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Error returning object from Remote method
 
Similar Threads
RMI:at client side getting exceptrion like java.io.NotSerializableException
Returning ResultSet from Bean class to client
Arguments / Return values for a Remote Method
Error: cannot narrow to remote object
standard error messaging in jax-ws