GWT 2.5.1中的序列化 [英] Serialization in GWT 2.5.1

查看:134
本文介绍了GWT 2.5.1中的序列化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经将我的项目从GWT 2.4.0更新到了GWT 2.5.1,并且突然间一个特定的RPC序列化已经停止工作(所有其他的仍在工作)



我有这个类:

  public class StatusChangeMapEntity extends RecordStamp implements Serializable {

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

消息是:

 当类类为Slide的对象被期望时,试图反序列化类Pair类型的对象

类Slide扩展了StatusChangeMapEntity并且是正在反序列化的对象。



任何ideias如何解决这个问题?



谢谢。

解决方案

我设法解决了这个问题。基本上我创建了一个扩展HashMap的类:

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

然后创建一个CustomSerializer给MapStatusChanges 。



这不是一个通用的解决方案,但它的工作原理是在GWT解决这个问题。



帮助....


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.

解决方案

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

这篇关于GWT 2.5.1中的序列化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆