Simon,
Even i have observed the similar behavior when i have migrated my app
to use newer version of GWT and have been trying to resolve with some
changes at our code level instead of GWT API which can create issues
once we upgrade to latest version of it in the future.
Coming back to the point, cant we have private setters exposed for the
GWT API to call these and update the object with the proper data ?
These private setters would ensure no other class can set some stale
data into the main object.

On Jan 19, 4:12 pm, Simon Vogensen <[email protected]> wrote:
> Hi
>
> I've been trying to upgrade a project from gwt 1.6.4 to 2.0, but had a
> hard time figuring out why I got a nullpointer exception when
> deserializing on the serverside.
> It turns out that there's been made a change in the way RPC works
> between version 1.x and 2.0. (I cant see its documented anywhere - not
> even in the issuelist - maybe others can point to something?)
>
> In 1.x when an objects fields are set it's done via reflection on the
> field directly. But in 2.0 the serializer first looks for a related
> setter method and uses that if it exists instead.
>
> My problem was that in our project we dont use simple DAO classes
> between client and server, we use the same domainmodel on both server
> and clientside - so the transfered classes contains alot of
> businesslogic - which also means that the setters contains logic with
> object references which may not have been deserialized yet!
>
> As far as I can see theres no option to disable the new feature.
> Correct me if im wrong?
>
> So our solution was to patch deserializeClass(Class<?> instanceClass,
> Object instance) in ServerSerializationStreamReader.java:595 in a way
> so it dont use setter methods when deserializing.
>
> Hope this post will help others.. :)
>
> Cheers
> Simon
-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.


Reply via email to