GWT - occasional com.google.gwt.user.client.rpc.SerializationException

后端 未结 11 1175
走了就别回头了
走了就别回头了 2020-12-13 08:47

we are haunted by occasional occurences of exceptions such as:

com.google.gwt.user.client.rpc.SerializationException: Type \'xxx\' was not assignable

11条回答
  •  臣服心动
    2020-12-13 09:42

    I assume you're running the application on localhost and in hosted mode? If so, you might want to keep an eye on the work directory (or the equivalent directory if you're not running the application in a tomcat server). Check the webapp's folder for serialization policiy files (*.gwt.rpc).

    It's possible they're not loaded correctly, the only workaround we have found so far, is to restart your server after each serialization fault.

    The problem is due to the fact GWT will generate its serialization policy files at run time, assuming you're running in hosted mode. In compiled mode, GWT will generate all necessary files at compile time. AFAIK, tomcat's unable to load in the resource files at run time and hence will not include the serialization files each time they are needed for the first time.

    When restarting the server, tomcat's able to pick up the previously generated file and hence you shouldn't receive the same error after restarting.

    Can you verify this?

提交回复
热议问题