我正在使用gwt與gwt平臺並使用調度異步進行服務器調用。我遇到的問題是,我正在使用的操作未被標記爲可序列化或被添加到* .gwt.rpc文件。當我的代碼運行在我com.google.gwt.user.client.rpc.impl.SerializerBase.getTypeHandler(SerializerBase.java獲得GWT RPC沒有生成正確的gwt.rpc文件
com.google.gwt.user.client.rpc.SerializationException : 153) at com.google.gwt.user.client.rpc.impl.SerializerBase.serialize(SerializerBase.java:125) at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamWriter.serialize(ClientSerializationStreamWriter。 java:183) at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject(AbstractSerializationStreamWriter.java:126) at com.gwtplatform.dispatch.shared.DispatchService_Proxy.execute(DispatchService_Proxy.java:33) at com.gwtpla tform.dispatch.client.DefaultDispatchAsync.serviceExecute(DefaultDispatchAsync.java:126) 在com.gwtplatform.dispatch.client.DefaultDispatchAsync.execute(DefaultDispatchAsync.java:...
行動:
public class FindCallsWithFilterAction extends UnsecuredActionImpl<FindCallsWithFilterResult> {
public FindCallsWithFilterAction() {
}
public Date getAfter() {
return after;
}
public Date getBefore() {
return before;
}
public Long getReferenceNumber() {
return referenceNumber;
}
public String getUser() {
return user;
}
public void setAfter(Date after) {
this.after = after;
}
public void setBefore(Date before) {
this.before = before;
}
public void setReferenceNumber(Long referenceNumber) {
this.referenceNumber = referenceNumber;
}
public void setUser(String user) {
this.user = user;
}
public boolean hasAfter(){
return null != after;
}
public boolean hasBefore(){
return null != before;
}
public boolean hasReferenceNumber(){
return null != referenceNumber;
}
public boolean hasUser(){
return null != user;
}
private Date after = null;
private Date before = null;
private Long referenceNumber = null;
private String user = null;
}
Action有結果,處理程序和處理程序綁定在我的服務器模塊中。當我調試代碼並查看gwt生成此操作的序列化映射並且其結果不存在事件時,雖然這實現了isSerializable接口(在超類中,如果我在此使用Serializable或isSerializable,它仍然不起作用級別)。當我查看我的* .gwt.rpc文件時,該類也不在其中。我只是卡住了,希望有人會知道該怎麼做或什麼是錯的。
更新:我不知道它是否相關,但我在服務器上使用spring。
http://stackoverflow.com/questions/6604106/can-anything-be-serialized-as-long-as-it-implements-serializable/#6604664 –
http://stackoverflow.com/questions/11516675/ java的UTIL-鏈表-nodee可任意不待分配到GWT序列化/ 11534536#11534536 –