Serialization in GWT 2.5.1

2019-08-12 17:14发布

I've updated my project from GWT 2.4.0 to GWT 2.5.1 and suddenly a specific RPC serialization has stopped work (all other are still working).

I have this class:

public class StatusChangeMapEntity extends RecordStamp implements Serializable {

    private HashMap<WFStatus, Pair<WFPhase, ArrayList<Pair<AppUser, Date>>>> map;
    ...
    ...
}

The exception message is:

Attempt to deserialize an object of type class Pair when an object of type class Slide is expected

The class Slide extends StatusChangeMapEntity and is the object that is being deserialized.

Any ideias how to solve this problems?

Thanks.

1条回答
看我几分像从前
2楼-- · 2019-08-12 18:12

I've managed to solve this problem. Basically I've created a class extending the HashMap:

public class MapStatusChanges extends HashMap<WFStatus, Pair<WFPhase, ArrayList<Pair<AppUser, Date>>>> {
   ...
}

And then created a CustomSerializer to the MapStatusChanges.

It's not a generic solution, but it works until this problem is solved at GWT.

Hope this helps....

查看更多
登录 后发表回答