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

后端 未结 11 1058
走了就别回头了
走了就别回头了 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:40

    I've had the same error and fix this by clean the browse cache and navigation history.

    0 讨论(0)
  • The best way to know the exact issue is to compile your code using -logLevel DEBUG or TRACE and check inside Validating Units. I am sure you would be able to find out the exact issue with line numbers as well.

    0 讨论(0)
  • 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?

    0 讨论(0)
  • 2020-12-13 09:42

    I was getting a SerializationException also but I was also seeing this error showing up right before the serialization exception:

    [uptimereports/2.340102563369350884].: Example : error : cannot find template registration-confirmation.vm

    It turned out to be a problem finding my velocity template. Once I fixed that problem the SerializationException stopped showing up, so if you follow Kerem's advice and still have problems, look for other exceptions in your log.

    0 讨论(0)
  • 2020-12-13 09:44

    This problem occurs when a GWT 2.5 application is compiled using JDK 1.7. GWT 2.5 supports JDK 1.6 and using this version of JDK will fix this issue.

    0 讨论(0)
提交回复
热议问题