This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Client requries .clss file of Remote Interface. Why?
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
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
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.
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...