SerializationPolicy error when performing RPC from within GWT application

后端 未结 10 2093
醉梦人生
醉梦人生 2020-12-14 01:59

I\'m getting the following exception:

com.google.gwt.user.client.rpc.SerializationException: Type \'java.lang.Long\' was not included in the set of ty

10条回答
  •  轮回少年
    2020-12-14 03:01

    Inspired by http://groups.google.com/group/google-web-toolkit/browse_thread/thread/7dd5123d359ddfa8

    Using eclipse and maven and gwt 2.1.1

    Compile and deploy gwt war.

    Try using OOPHM launched from Eclipse.

    This would fail for me.

    This will generate in server logs:

    ERROR: The serialization policy file 'blah.gwt.rpc' was not found; did you forget to include it in this deployment?

    WARNING: Failed to get the SerializationPolicy '94DEC228B2828D3A5897FEE3D6845A40' for module 'http://blah:8080/BlahUI/BlahUI/'; a legacy, 1.3.3 compatible, serialization policy will be used. You may experience SerializationExceptions as a result.

    And then

    Exception while dispatching incoming RPC call com.google.gwt.user.client.rpc.SerializationException: Type '[LpathToClass;' was not assignable to 'com.google.gwt.user.client.rpc.IsSerializable' and did not have a custom field serializer.For security purposes, this type will not be serialized.: instance = [LpathToClass;@9d524af at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize(ServerSerializationStreamWriter.java:614)

    Now that extra gwt.rpc files have been generated (either by eclipse/maven plugin who knows?)

    Recompile (even a clean compile will work because the gwt.rpc files are not in the target folder, my OOPHM gwt.rpc files are at same folder as entrypoint html) and redeploy. This new war file will contain the generated gwt.rpc files.

    Relaunch OOPHM from Eclipse.

    Works for me.

提交回复
热议问题