Andre
Andre

Reputation: 9170

How can I avoid the MarshalException for Java RMI?

I just finished a small program with java rmi and somehow it doesn't work. Everytime I want to start the server I'm getting the MarshalException. Are there any important points that I should be aware of them on how to implement the interface for the remote method invocation? I thought it would be possible to create an implementation but also include some additional methods like a constructor or private variables inside of the implementing class.

Shouldn't this just work?

Greetings

Upvotes: 1

Views: 5426

Answers (2)

user207421
user207421

Reputation: 310979

Caused by: java.lang.ClassNotFoundException: vsys.ue04.server.RemoteChargeImplementation

There's your problem. That class is required at the client.

Upvotes: 1

Bozho
Bozho

Reputation: 597254

In order to be able to transfer objects you need to make them implement Serializable. And perhaps have a default (no-arg) constructor (this is not a requirement for serialization though)

As helios noted, not only the class, but all your field hierarchy (classes of fields, and the classes of their fields) must be Serializable)

Upvotes: 3

Related Questions