This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error returning object from Remote method

 
naveen chinthakunta
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 291
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic