• Post Reply Bookmark Topic Watch Topic
  • New Topic

RMI problem  RSS feed

 
Jacob Hoda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying a bare bone RMI for testing.
When running the client side java file I get this exception:
java.rmi.MarshalException: error marshalling arguments; nested exception is:
java.io.NotSerializableException: java.lang.Object
This occurs when I'm calling a method with an object as a parameter.
I tried making that object serilizable but that didnt work.
Any help is appreicated.
Jacob
 
Raj Chila
Ranch Hand
Posts: 128
Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jacob,
I think all Objects that are exchanged in RMI, must be serializable...that means they must have implemented the Serializable interface.
 
Julie de Wet
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess is that in the parameter list of the method, the type of the object is given as being Object, and not as being that of your class which implements Serializable... So even if the instance you pass in is Serializable, if you send it as an Object, it will throw an Exception, because in general Objects aren't Serializable...
 
Jacob Hoda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to all, yes that was the problem.
It works fine now, my RMI runs fine locally but have problems now with stubs when I run it on server. I will post a new thread for this.
Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!