gwt serialization policy hosted mode out of sync

后端 未结 2 2072
青春惊慌失措
青春惊慌失措 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:13

    I've been having the same problem. The only solution I see, is to make sure you have the same .gwt.rpc files on both sides.

    That means, everytime you start or reload Dev Mode, you have to replace the old .gwt.rpc files deployed on your web server with the newly generated ones.

    Or you point the Dev Mode war output directory to the web server context. And make sure the web server has auto-deploy turned on. So every time the files are changed by Dev Mode, the web server automatically reloads the files.

    0 讨论(0)
  • 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 :)
    0 讨论(0)
提交回复
热议问题