GWT SerializationPolicy whitelist
I have a GWT project which was working earlier on, but have stopped working.
The error I receive is:
com.google.gwt.user.client.rpc.SerializationException: Type 'java.util.ArrayList' 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.
Now the gwt compiling gave this output:
Verifying instantiability dk.web.client.Dummy Analyzin开发者_运维问答g the fields of type 'dk.web.client.Dummy' that qualify for serialization private java.util.ArrayList al java.util.ArrayList Verifying instantiability java.util.ArrayList [WARN] Checking all subtypes of Object which qualify for serialization
I have zero argument constructor on all classes that are use in the RPC service and they all implements IsSerializable.
The dummy class above has all classes used in the RPC service in an attempt to add missing classes to the SerializationPolicy whitelist.
What could I be missing?
Thanks
How are you instantiating your ArrayList, are you giving the generic a type?
ArrayList<Object>
for example is not allowed. Where using a serializable object like ArrayList<String>
would be.
As of GWT1.4 there has been support for java.io.Serializable see here. Can you try making your classes extend Serializable instead?
GWT has a JRE emulation for ArrayList so I would guess it was a problem with your class.
精彩评论