简体   繁体   English

具有错误的类定义的GWT托管模式RPC序列化文件导致IncompatibleRemoteServiceException

[英]GWT Hosted Mode RPC Serialization file with bad class definition causes IncompatibleRemoteServiceException

I have a GWT project in Eclipse that throws a com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException when using hosted mode because the code server RPC file hashcode does not match the server RPC file hashcode. 我在Eclipse中有一个GWT项目,使用托管模式时会抛出com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException ,因为代码服务器RPC文件哈希码与服务器RPC文件哈希码不匹配。

I've tracked this down to a couple classes that implement com.extjs.gxt.ui.client.data.BeanModelTag . 我已经将其追溯到实现com.extjs.gxt.ui.client.data.BeanModelTag的几个类。 These classes appear to be included in the code server generated RPC file incorrectly. 这些类似乎错误地包含在代码服务器生成的RPC文件中。 Additionally, the class names appear mangled. 此外,类名称出现乱码。

For example, instead of com.acme.beans.MyBean the class is referenced as com.acme.beans.BeanModel_com_acme_beans_MyBean . 例如,该类不是com.acme.beans.MyBean而是被引用为com.acme.beans.BeanModel_com_acme_beans_MyBean

I suspect this has something to do with the class path for my debug target incorrectly including some jar, src dir, or other project incorrectly, but I don't have good feel for how to debug this further. 我怀疑这与我的调试目标的类路径不正确有关,其中包括不正确的jar,src dir或其他项目,但是我对如何进行进一步调试没有很好的感觉。

GXT 2 (current is 3, 4 should beta soonish) had a feature where it could generate BaseModelData types based on a java bean or pojo, allowing for reflection-like features that GXT 2 used to render templates and grid cells (GXT 3 has compile-time features that work out that property access instead). GXT 2(当前应为3,现在应为beta,应为4,GXT 2)具有一项功能,可以基于Java bean或pojo生成BaseModelData类型,从而允许GXT 2用于呈现模板和网格单元的类似反射的功能(GXT 3已编译) -时功能可解决该属性访问问题)。 The BeanModels are not meant to be sent over the wire - instead, you should be sending your original MyBean over the wire. BeanModels并不是要通过电线发送的-相反,您应该通过电线发送原始的MyBean。

This generated BeanModel instance is designed to wrap the original MyBean, and is only available to the client code. 此生成的BeanModel实例旨在包装原始MyBean,并且仅可用于客户端代码。 To pass back to the server again, unwrap the bean - use getBean() to get the underlying pojo. 要再次传递回服务器,请解开bean-使用getBean()获取基础pojo。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM