This is my client side code to get the string "get-image-data" through RPC calls and getting byte[] from the server.
CommandMessage msg = new CommandMessage(itemId, "get-image-data");
cmain.ivClient.execute(msg, new AsyncCallback<ResponseMessage>() {
@Override
public void onFailure(Throwable caught) {
}
@Override
public void onSuccess(ResponseMessage result) {
if (result.result) {
result.data is byte[].
}
}
});
From the server side I got the length of the data is 241336.
But I could not get the value in onSuccess method. It is always goes to onFailure method.
And I got log on Apache:
com.google.gwt.user.client.rpc.SerializationException: Type '[B' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded.
How can I do serialisation in GWT?
ResponseMessagelook like? The error says that byte[] cant be sent over the wire, and in your case, the server is saying that it isn't permitted for it to send that data. - Colin Alworth