• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client requries .clss file of Remote Interface. Why?

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have RMI application, in which my remote interface has some methods which are taking one serialised objects as argument while some are returning serialised objects.
Now after giving the codebase corectly my client can download the stub properly provided the .class files of remote interfaces and all the serialised object's .class are copied to the client appropriate directory. If I remove these files from client side it gives me exception saying NoClassDefFound.
Is client really needs the remote interface's and serialized object's .class flies? As per my knowledge it should download from from the server. Can anybody hel me?
Thanks in advance
Hemant
 
paul wheaton
Trailboss
Pie
Posts: 21890
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When the object is serialized, it sends only the data that makes each object unique. The methods are not sent. Instead, all the class definition stuff must be on both sides.
 
Lucy C
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as I know, the client application needs the remote interface class because it's referenced directly in the client code and is used when casting the returned stub reference to the appropriate type.
Any classes that the application needs for unmarshalling, eg the stub and the classes for method parameters and return values, should be available from the codebase. I think...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic