This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
standard error messaging in jax-ws
Error: cannot narrow to remote object
RMI:at client side getting exceptrion like java.io.NotSerializableException
Returning ResultSet from Bean class to client
Arguments / Return values for a Remote Method