【问题标题】:RPC Serialization policy file under AppEngineAppEngine 下的 RPC 序列化策略文件
【发布时间】:2011-12-10 13:40:01
【问题描述】:

GWT / AppEngine RPC 接口正在吞噬我!我收到这样的错误:

INFO: javax.servlet.ServletContext log: UserService: ERROR: The serialization policy file '/55585D0849A4549E3FCE91B33725B02F.gwt.rpc' was not found; did you forget to include it in this deployment?

每次我启动 Devserver。我已经在appengine-web.xml 中正确设置了public-root(除了.gwt.rpc 文件之外,应用程序的其余部分都可以正常使用)。

  <static-files>
    <include path="**" />
    <include path="**.nocache.*" expiration="0s" />
    <include path="**.rpc" expiration="0s" />
    <include path="**.cache.*" expiration="365d" />
  </static-files>

  <resource-files>
    <include path="**.gwt.rpc" />
  </resource-files>

我做错了什么?请帮忙!

【问题讨论】:

    标签: java google-app-engine gwt rpc


    【解决方案1】:

    经过一些实验,这是我想出的:

    • 不要忘记将.rpc 文件包含在appengine 部署中(appengine-web.xml 文件)并注意缓存问题! (例如,序列化政策的变化)
    • 最好不要在appengine-web.xml 中使用public-root 标记:将welcome file(例如index.html)放到war 目录的/ 中,并为GWT 进行适当的更改以找到其文件李>
    • 更新 servlet url-pattern 标记以指向 war 目录内的 GWT 生成目录

    • 对于与tasks(即web hooks)关联的servlet,不要更改url-pattern

    因此,需要了解 GWT 生成的文件夹的唯一位置位于 web.xml。当然,GWT项目的welcome-file也必须适配。

    希望这对某人有所帮助

    【讨论】:

    • 您好,我在 App Engine 日志中看到了类似的错误。您能否详细说明“提防缓存问题! (例如,序列化政策的变化)'?谢谢。
    • 在客户端缓存 .rpc 文件,即必须传播 .rpc 中的更改。
    • 我得到了这个错误,因为我有一个不包含“**.gwt.rpc”的 块。我删除了它,它现在可以工作了。
    【解决方案2】:

    我在部署的 GAE 服务器上遇到了同样的问题,直到我为资源文件部分添加了 rpc 包含,错误才消失。这是我最终得到的结果:

    <resource-files>
        <include path="/resources/**" />
        <include path="**.gwt.rpc"/>
    </resource-files>
    
    <static-files>
      <include path="**" />
      <include path="**.nocache.*" expiration="0s" />
      <include path="**.cache.*" expiration="365d" />
      <exclude path="**.gwt.rpc"/>
    </static-files>
    

    【讨论】:

      猜你喜欢
      • 2012-06-23
      • 1970-01-01
      • 2014-02-20
      • 2021-05-26
      • 2014-06-22
      • 2014-08-15
      • 1970-01-01
      • 2023-04-07
      相关资源
      最近更新 更多