gwt serialization policy hosted mode out of sync

后端 未结 2 2091
青春惊慌失措
青春惊慌失措 2021-01-05 05:56

When running my GWT application (gwt 2.0.4) in hosted mode, calling RPC methods running on remote Tomcat, I get GWT serialization exception:

INFO: GwtRpcEven         


        
2条回答
  •  情深已故
    2021-01-05 06:27

    Based on what I see in com.google.gwt.user.rebind.rpc.ProxyCreator GWT generates the names of the serialization policy .gwt.rpc files by their content (md5).

    So for some reason the serialization policy in the Super Dev Mode is different than the one generated during the normal build.

    The following approach fixed the problem for me:

    1. Open the serialization policy .gwt.rpc file generated for the regular build
    2. Open the serialization policy .gwt.rpc file generated for the Super Dev Mode. You can find where it is by looking into the work directory printed at Super Dev Mode startup. E.g. in my case it was: "workDir: C:\Users\your_user\AppData\Local\Temp\gwt-codeserver-5658052675265790575.tmp"
    3. Compare the 2 files - this could give you a pretty good hint regarding where the problem might be. In my case 2 unneeded types were getting added to the serialization policy and I could simply remove them from the project completely.
    4. After fixing the discrepancies the .gwt.rpc files name should be identical again and the problem will be fixed :)

提交回复
热议问题