W dniu 21.08.2017 o 02:05, Thomas Broyer pisze:
Hello,
On Monday, August 21, 2017 at 1:13:42 AM UTC+2, Łukasz Bączek wrote:W dniu 21.08.2017 o 00:27, Thomas Broyer pisze:
>
> Like in any Java environment, as long as you only use the part of the
> API that's emulated in GWT:
> http://www.gwtproject.org/doc/latest/RefJreEmulation.html# Package_java_math
>
Yes, it just does not work
com.google.gwt.user.client.rpc.SerializationException: Type
'java.math.BigInteger' was not included in the set of types which can be
serialized by this SerializationPolicy or its Class object could not be
loaded. For security purposes, this type will not be serialized.:
instance = 123
at
com.google.gwt.user.server.rpc.impl. ServerSerializationStreamWrite r.serialize( ServerSerializationStreamWrite r.java:667)
at
com.google.gwt.user.client.rpc.impl. AbstractSerializationStreamWri ter.writeObject( AbstractSerializationStreamWri ter.java:130)
at
com.google.gwt.user.client.rpc.core.java.util.Map_ CustomFieldSerializerBase. serialize(Map_ CustomFieldSerializerBase. java:53)
at
com.google.gwt.user.client.rpc.core.java.util.HashMap_ CustomFieldSerializer. serialize(HashMap_ CustomFieldSerializer.java:39)
at
com.google.gwt.user.client.rpc.core.java.util.HashMap_ CustomFieldSerializer. serializeInstance(HashMap_ CustomFieldSerializer.java:51)
at
com.google.gwt.user.client.rpc.core.java.util.HashMap_ CustomFieldSerializer. serializeInstance(HashMap_ CustomFieldSerializer.java:28)
Oh, so this is about use with GWT-RPC then, not BigInteger by itself.It's supposed to work too though; tested here: https://github.com/gwtproject/gwt/blob/2.8.1/user/test/com/google/gwt/user/client/rpc/ValueTypesTest.javaCan you show your code that fails?
The information helped me:
Make sure your generics at least implement some interface and you'll be good to go;
the compiler then sees the classes that need to be on the whitelist, as they are referenced
in the RPC method (references via this interface)
(e.g. instead of HashMap<String,Object>, use HashMap<String,MyInterface>)
Found here: https://github.com/gwtproject/gwt/issues/5810
No comments:
Post a Comment