我有一个返回可序列化对象列表的方法,我对此方法进行RPC调用,一切顺利,直到反序列化过程:我收到以下消息:“响应无法反序列化”
注意:这是我的gwt-rpc响应字符串:
/ / OK [0,2768,3,2,0,2764,3,2,0,2761,3,2,0,2754,3,2,0,2750 , 3,2,0,2610,3,2,0,2606,3,2,0,2603,3,2,0,2600,3,2,9,1 ["java.util.ArrayList/3821976829 "" myPackage.MyEntity/845101117 "," java.lang.Integer/3438268394 "], 0.7]
DTO
public class MyEntity implements Serializable,IsSerializable
{
private static final long serialVersionUID = -9032157988566853424L;
public MyEntity ()
{
super();
}
private Integer _entityId;
private String _name;
public Integer getEntityId()
{
return _entityId;
}
public void setEntityId(Integer entityId)
{
this._entityId = entityId;
}
public String getName()
{
return _name;
}
public void setName(String _name)
{
this._name = _name;
}
}
接口
@RemoteServiceRelativePath("ContributorService.rpc")
public interface ContributorService extends RemoteService
{
ArrayList<MyEntity> myMethod(Arg arg);
}
public interface ContributorServiceAsync
{
void myMethod(Arg arg, AsyncCallback<ArrayList<MyEntity>> callback);
}
服务器实施:
@SuppressWarnings("serial")
public class ContributorServiceImpl extends RemoteServiceServlet implements ContributorService
{
@Override
public ArrayList<MyEntity> myMethod(Arg arg)
{
ArrayList<MyEntity> myList = new ArrayList<MyEntity>();
MyEntity myEntity=new MyEntity();
//code...
myList .add(myEntity);
return myList;
}
}
感谢您的帮助
答案 0 :(得分:1)
感谢大家的帮助 这是一个愚蠢的错误,我仍然无法理解。 我更改了GWT sdk并且该程序工作,然后我使用旧的SDK来确保问题来自sdk,但程序仍然可以正常工作':(
我对过去的事情一无所知,但我的申请工作越重要:)