0

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.

I've tracked this down to a couple classes that implement com.extjs.gxt.ui.client.data.BeanModelTag. These classes appear to be included in the code server generated RPC file incorrectly. 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.

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.

Kylos
  • 1,888
  • 14
  • 24

1 Answers1

0

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). The BeanModels are not meant to be sent over the wire - instead, you should be sending your original MyBean over the wire.

This generated BeanModel instance is designed to wrap the original MyBean, and is only available to the client code. To pass back to the server again, unwrap the bean - use getBean() to get the underlying pojo.

Colin Alworth
  • 17,801
  • 2
  • 26
  • 39
  • Thanks for the information. I think the bean is getting unwrapped properly before sending to the server. The problem is I can't figure out how the generated file is appearing in my hosted mode.rpc if the bean is client side only. – Kylos Aug 14 '15 at 16:13
  • Without any attempt at showing code (esp for a library that is almost two major versions behind current, so clearly worked for many people and then they moved on...), its hard to say one way or another why it isn't working. That said, it appears in the .rpc manifest file because the GWT compiler *can* see it, because it created it. The fact that it is there only means that the client code knows how to de/serialize it, but says nothing about whether or not there is legal code that can send it to the server or not. – Colin Alworth Aug 17 '15 at 14:33