GIGJ.COM
welcome to my space
X
Welcome to:gigj.com
Search:  
Personal Injury | Languages | Soups | Photography | Email | Prepress | Exotic Locations | Computer Games | Related articles
 HOME   Unable to transfer BaseModelData object graphs through GWT-RPC

Unable to transfer BaseModelData object graphs through GWT-RPC

Published by: admin 2010-03-14

  • I am trying to send an object similar to the UserModel object in the Dozer tutorial back to my client through GWT-RPC.

    However, I am getting a warning that points out that the Model contained within UserModel (namely, the AddressModel) cannot properly be serialized.

    Is there something about which I need to be aware for any child Model objects to be serialized properly?

    [WARN] StandardContextException while dispatching incoming RPC call

    Caused by: com.google.gwt.user.client.rpc.SerializationExcept ion: Type 'com.softroots.sonic.client.model.AddressModel' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.


  • I experienced this problem earlier. Seems the GWT serializer doesn't like GXT model objects containing other GXT model objects, especially if one contains a collection of the other I think.

    Workarounds I found couple of months ago:

    1. Make your model objects inherit from BaseTreeModel instead of BaseModel

    or

    2. Add a dummy field to your containing model object, e.g. "private Integer private = 1;"
    and make sure it implements Serializable

    Try it out and tell us how it goes


  • Thank you for the response. Unfortunately, none of the suggestions worked, nor a combination of the suggestions worked.

    Darrell, in your tests, can you try sending an object graph of Models through the GWT-RPC??


  • GWT does not "see" the types stored in the internal map. Add a dummy field to your subclass with a type of AddressModel. If you still have problems then post your code for UserModel. Both AddressModel and UserModel should implement Serialazable directly, not via a subclass.


  • Two questions before I plunge into this, as this looks like a terrific solution.

    1) I assume that since this works with stores, I will be able to use this solution for anything that uses a store (tables, lists...) and not just the Grid you provided as an example?

    2) Does this handle nested-objects correctly as the simple work-around for the BaseModel does?

    I am looking forward to using this!


  • Do your model objects have zero arg constructors?


  • Yes, adding the dummy field of the type that was causing the serialization problem worked.

    Grandiosa and Darrell, thank you both for your assistance. Hopefully this helps others as well!


  • Yes. They do have zero-argument constructors.
    Have you any idea why subclassing from BaseModel or BaseModelData does not allow nested Models to be properly serialized? Would it be futile to try and rewrite my own BaseModel for serialization? Is this a bug in the models?


  • Take a look at this blog post for new Java Bean support. With this approach, you can send any bean (not GXT models) objects via RPC and use then with a Store.


  • 1) I assume that since this works with stores, I will be able to use this solution for anything that uses a store (tables, lists...) and not just the Grid you provided as an example?
    Yes.
    2) Does this handle nested-objects correctly as the simple work-around for the BaseModel does?
    Not at this time. However, I hope to add this feature soon.





  • Nortel Unveils Vision, Strategy for Israeli High-Performance Net
    Busy Friday Leads to Strong Close for Net Stocks

    You are looking at:gigj.com's Unable to transfer BaseModelData object graphs through GWT-RPC, click gigj.com to home
  • object model
  • object model
  • hold for 5 secs
  • movieclip onload fix
  • useful tutes not kirupa
  • bad graphic jitters
  • making the flash menu go awaaay
  • question with using prototypes
  • useful tutes not kirupa
  • tutorial real time bandwidth based redirection php
  • fmx indexof replace words
  • i need help on action scripting
  • multidy arrays and objects
  • new battle forum
  •  
  • i need help on action scripting
  • text creation
  • tutorial real time bandwidth based redirection php
  • forward and backward
  • text creation
  • question with using prototypes
  • multidy arrays and objects
  • new battle forum
  • fmx indexof replace words
  • prototype preloader use it
  • prototype preloader use it
  • bad graphic jitters
  • making the flash menu go awaaay
  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about Unable to transfer BaseModelData object graphs through GWT-RPC , Please add it free.
     Homepage | Add to favorites | Contact us | Exchange links | LOGIN | Site map | 
    Copyright© 2008 gigj.com        Site made:CFZ