Hello,
I am trying to send a class instance from server to client. As long as the instance is null it is sent to the client and my ClientRpc class is executed and all is ok.
When I actually try to send an instance I receive RuntimeException: Can not deserialize com.abc…gwt.client.MyClass
I tried to simplify the class and now looks like this:
public class MyClass implements Serializable {
public MyClass() {
// TODO Auto-generated constructor stub
}
}
on the server inside my AbstractExtension class implementation I do:
MyClassRpc rpcProxy = getRpcProxy(MyClassRpc.class);
rpcProxy.send(new MyClass());
Then I have MyClassRpc:
public interface MyClassRpc extends ClientRpc {
void send(MyClass mc);
}
On the client side inside MyClassConnector I have:
private MyClassRpc rpc = new MyClassRpc() {
@Override
public void send(MyClass mc) {
Window.alert("send value=" + mv);
}
};
If I change the communication class type (the send() method) to String instead of MyClass it works with null or any other string passed.
What do I have to implement to be able to send a custom java class instance to the client part? In GWT you just mark as serializable and you are good to go.
Thank you.