Serialization in GWT 2.5.1

感情迁移 提交于 2019-12-11 06:40:09

问题


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:


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....



来源:https://stackoverflow.com/questions/15620299/serialization-in-gwt-2-5-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!