Results 1 to 4 of 4

Thread: SerializationException with nested BaseModel objects

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    14
    Vote Rating
    0
      0  

    Default SerializationException with nested BaseModel objects

    Hi. I did search the forum but found no answers, and I'm not sure it's a GXT or a GWT issue.

    I have the following situation:

    class CategoryModel extends BaseModel {}

    class PersonModel extends BaseModel {
    public void setCategory(CategoryModel c) {
    set("category", c);
    }

    public CategoryModel getCategory() {
    return get("category");
    }
    }

    In my servlet I read "person" joinning it's "category", create the PersonModel, setting the CategoryModel property after that.

    After the method ends, occurs a SerializarionException. The server log shows the following:

    Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'br.unitoledo.base2.gwt.client.comum.models.CategoryModel' 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.: instance = br.unitoledo.base2.gwt.client.comum.models.CategoryModel@1b6a48d

    The problem occurs only when I have nested ModelData insite another ModelData object. It doesn't work both ways (browser to servlet, servlet to browser).

    Somebody having the same problem? Thanx in advance.

  2. #2
    Sencha Premium Member
    Join Date
    Sep 2007
    Posts
    13,976
    Vote Rating
    132
      0  

    Default

    Code:
    class PersonModel extends BaseModel {
    
    private CategoryModel unsed;
    
    public void setCategory(CategoryModel c) {
    set("category", c);
    }
    
    public CategoryModel getCategory() {
    return get("category");
    }
    }

  3. #3
    Sencha User
    Join Date
    Jul 2010
    Posts
    14
    Vote Rating
    0
      0  

    Default

    Thanx a lot. That solved the problem.

  4. #4
    Sencha User
    Join Date
    Aug 2012
    Posts
    3
    Vote Rating
    0
      0  

    Default

    thanks

Similar Threads

  1. Problem with nested properties in BaseModel
    By rotschi in forum Ext GWT: Discussion
    Replies: 0
    Last Post: 25 Sep 2009, 7:13 AM
  2. Replies: 0
    Last Post: 2 May 2008, 5:00 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •