1

升级所有库后,我才开始遇到此问题:

我使用的是 GWT 2.4、App Engine 1.6.3 和 Objectify 3.0。

我升级到 GWT 2.5、App Engine 1.7.4 和 Objectify 4.0b1。

从那以后,我收到了这个奇怪的错误,整个互联网上似乎只有另外一个人!

堆栈跟踪:

Caused by: com.google.gwt.user.client.rpc.SerializationException: com.google.appengine.api.datastore.Key/1349195865
    at com.google.gwt.user.client.rpc.impl.SerializerBase.getTypeHandler(SerializerBase.java:153)
    at com.google.gwt.user.client.rpc.impl.SerializerBase.instantiate(SerializerBase.java:114)
    at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:396)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
    at com.googlecode.objectify.Key_FieldSerializer.deserialize(Key_FieldSerializer.java:11)
    at com.googlecode.objectify.Key_FieldSerializer.deserial(Key_FieldSerializer.java:29)
    at com.google.gwt.user.client.rpc.impl.SerializerBase.deserialize(SerializerBase.java:95)
    at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:398)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
    at com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.deserialize(Collection_CustomFieldSerializerBase.java:34)
    at com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.deserialize(ArrayList_CustomFieldSerializer.java:34)
    at com.google.gwt.user.client.rpc.core.java.util.ArrayList_FieldSerializer.deserial(ArrayList_FieldSerializer.java:19)
    at com.google.gwt.user.client.rpc.impl.SerializerBase.deserialize(SerializerBase.java:95)
    at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:398)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
    at com.utilitiessavings.testapp2.shared.Account_FieldSerializer.deserialize(Account_FieldSerializer.java:29)
    at com.utilitiessavings.testapp2.shared.Account_FieldSerializer.deserial(Account_FieldSerializer.java:51)
    at com.google.gwt.user.client.rpc.impl.SerializerBase.deserialize(SerializerBase.java:95)
    at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:398)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
    at com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.deserialize(Collection_CustomFieldSerializerBase.java:34)
    at com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.deserialize(ArrayList_CustomFieldSerializer.java:34)
    at com.google.gwt.user.client.rpc.core.java.util.ArrayList_FieldSerializer.deserial(ArrayList_FieldSerializer.java:19)
    at com.google.gwt.user.client.rpc.impl.SerializerBase.deserialize(SerializerBase.java:95)
    at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:398)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
    at com.utilitiessavings.testapp2.client.action.GetAccountsResult_FieldSerializer.deserialize(GetAccountsResult_FieldSerializer.java:20)
    at com.utilitiessavings.testapp2.client.action.GetAccountsResult_FieldSerializer.deserial(GetAccountsResult_FieldSerializer.java:38)
    at com.google.gwt.user.client.rpc.impl.SerializerBase.deserialize(SerializerBase.java:95)
    at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:398)
    at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
    at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter$ResponseReader$8.read(RequestCallbackAdapter.java:106)
    at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:214)
    ... 27 more

反序列化 Account 时会出现问题,因为它包含包装本机数据存储密钥的 Objectify Key

序列化工作正常,我的对象图在数据存储中一切都很好而且花花公子,我只是无法取回任何包含密钥的东西,这几乎是所有有用的东西。

任何指针表示赞赏。

4

1 回答 1

0

我遇到了同样的问题,它似乎与数据存储无关,因为当我将一个对象发送到服务器并尝试取回它时,我仍然遇到反序列化错误。

AsyncCallService{

void createUser(User user, AsyncCallback<User> user);
}

ServiceImpl{

User createUser(User user){

DB.save(user);

return user

}

这仍然会导致客户端上的序列化错误或更确切地说是反序列化错误。

我所做的只是传回一个新用户;

User createUser(User user){
DB.save(user);
User newUser = new User();

newUser.setId(user.getId())

return newUser;

}

问题解决了,只是现在我失去了不需要反序列化的旧应用程序引擎堆栈的一些“好处”。

于 2013-02-09T19:59:29.800 回答