私は、複雑なデータ構造に格納されている 9 つの統計を計算するアプリケーションを持っていますHashMap<String, TreeMap<String, Integer>>
。すべての統計は、インターフェイス IStatistic を実装しています。結果は に保存されList<IStatistic>
、そのサイズ (最大の例) は 3.5MB です (手動でシリアル化してファイルに入れました)。結果をクライアントに送信するとき (通常、データ サイズが 1.5MB を超える場合、つまり、制限例外が発生しない場合) 奇妙な例外が発生し、同じ場所にあることはありません。
こことGWTの公式ページで見つけた問題に対する同様の解決策をすべて読んで試しました:
" https://developers.google.com/web-toolkit/doc/latest/tutorial/RPC http://stackoverflow.com/questions/2122798/gwt-occasional-com-google-gwt-user-client-rpc- serializationexception http://code.google.com/webtoolkit/doc/latest/tutorial/RPC.html#serializeを確認し ましたか? {} は機能します) シリアライズ可能なオブジェクトを作成しているときは、ゼロ引数 const. を常に忘れています :D "
しかし、実際には何も役に立ちませんでした。また、デバッグしようとしましたが、GWT ソースのどこかで壊れており、ソースが表示されません。興味深いことに、小さなデータ サンプルではすべてがスムーズに進みます。
GWT 2.4.0 を使用しています。アプリエンジンなし。
誰かが同様の問題を抱えていたり、これに対処するためのアドバイスを持っていますか?
Here are some example exceptions:
FIRST EXAMPLE:
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: The response could not be deserialized
at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:221)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
at sun.reflect.GeneratedMethodAccessor52.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Unknown Source)
Caused by: com.google.gwt.user.client.rpc.SerializationException: 2AS (6)
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:111)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
at com.google.gwt.user.client.rpc.core.java.util.Map_CustomFieldSerializerBase.deserialize(Map_CustomFieldSerializerBase.java:38)
at com.google.gwt.user.client.rpc.core.java.util.TreeMap_CustomFieldSerializer.deserialize(TreeMap_CustomFieldSerializer.java:36)
at com.google.gwt.user.client.rpc.core.java.util.TreeMap_FieldSerializer.deserial(TreeMap_FieldSerializer.java:15)
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:113)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
at com.google.gwt.user.client.rpc.core.java.util.Map_CustomFieldSerializerBase.deserialize(Map_CustomFieldSerializerBase.java:39)
at com.google.gwt.user.client.rpc.core.java.util.HashMap_CustomFieldSerializer.deserialize(HashMap_CustomFieldSerializer.java:34)
at com.google.gwt.user.client.rpc.core.java.util.HashMap_FieldSerializer.deserial(HashMap_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:113)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
at hr.fer.zesoi.metals.shared.statistic.result.StatisticM1Result_FieldSerializer.deserialize(StatisticM1Result_FieldSerializer.java:29)
at hr.fer.zesoi.metals.shared.statistic.result.StatisticM1Result_FieldSerializer.deserial(StatisticM1Result_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:113)
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:113)
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)
... 26 more
SECOND EXAMPLE:
com.google.gwt.dev.shell.HostedModeException: Something other than an int was returned from JSNI method '@com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader::readInt()': JS value of type string, expected int
at com.google.gwt.dev.shell.JsValueGlue.getIntRange(JsValueGlue.java:266)
at com.google.gwt.dev.shell.JsValueGlue.get(JsValueGlue.java:144)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeInt(ModuleSpace.java:247)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeInt(JavaScriptHost.java:75)
at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.readInt(ClientSerializationStreamReader.java)
at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.readString(ClientSerializationStreamReader.java:104)
at com.google.gwt.user.client.rpc.core.java.lang.String_CustomFieldSerializer.instantiate(String_CustomFieldSerializer.java:37)
at com.google.gwt.user.client.rpc.core.java.lang.String_FieldSerializer.create(String_FieldSerializer.java:11)
at com.google.gwt.user.client.rpc.impl.SerializerBase.instantiate(SerializerBase.java:115)
at com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader.deserialize(ClientSerializationStreamReader.java:111)
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.TreeSet_CustomFieldSerializer.deserialize(TreeSet_CustomFieldSerializer.java:36)
at com.google.gwt.user.client.rpc.core.java.util.TreeSet_FieldSerializer.deserial(TreeSet_FieldSerializer.java:15)
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:113)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
at com.google.gwt.user.client.rpc.core.java.util.Map_CustomFieldSerializerBase.deserialize(Map_CustomFieldSerializerBase.java:39)
at com.google.gwt.user.client.rpc.core.java.util.HashMap_CustomFieldSerializer.deserialize(HashMap_CustomFieldSerializer.java:34)
at com.google.gwt.user.client.rpc.core.java.util.HashMap_FieldSerializer.deserial(HashMap_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:113)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
at hr.fer.zesoi.metals.shared.statistic.IStatisticResult_FieldSerializer.deserialize(IStatisticResult_FieldSerializer.java:13)
at hr.fer.zesoi.metals.shared.statistic.result.StatisticM2Result_FieldSerializer.deserialize(StatisticM2Result_FieldSerializer.java:22)
at hr.fer.zesoi.metals.shared.statistic.result.StatisticM2Result_FieldSerializer.deserial(StatisticM2Result_FieldSerializer.java:40)
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:113)
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:113)
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)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
at sun.reflect.GeneratedMethodAccessor37.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
at sun.reflect.GeneratedMethodAccessor32.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Unknown Source)
THIRD EXAMPLE:
java.lang.NullPointerException
at java.util.TreeMap.put(Unknown Source)
at java.util.TreeSet.add(Unknown Source)
at com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.deserialize(Collection_CustomFieldSerializerBase.java:35)
at com.google.gwt.user.client.rpc.core.java.util.TreeSet_CustomFieldSerializer.deserialize(TreeSet_CustomFieldSerializer.java:36)
at com.google.gwt.user.client.rpc.core.java.util.TreeSet_FieldSerializer.deserial(TreeSet_FieldSerializer.java:15)
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:113)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
at com.google.gwt.user.client.rpc.core.java.util.Map_CustomFieldSerializerBase.deserialize(Map_CustomFieldSerializerBase.java:39)
at com.google.gwt.user.client.rpc.core.java.util.HashMap_CustomFieldSerializer.deserialize(HashMap_CustomFieldSerializer.java:34)
at com.google.gwt.user.client.rpc.core.java.util.HashMap_FieldSerializer.deserial(HashMap_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:113)
at com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamReader.readObject(AbstractSerializationStreamReader.java:119)
at hr.fer.zesoi.metals.shared.statistic.IStatisticResult_FieldSerializer.deserialize(IStatisticResult_FieldSerializer.java:13)
at hr.fer.zesoi.metals.shared.statistic.result.StatisticM4Result_FieldSerializer.deserialize(StatisticM4Result_FieldSerializer.java:44)
at hr.fer.zesoi.metals.shared.statistic.result.StatisticM4Result_FieldSerializer.deserial(StatisticM4Result_FieldSerializer.java:66)
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:113)
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:113)
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)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
at sun.reflect.GeneratedMethodAccessor42.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Unknown Source)