Wednesday, April 23, 2014

Why doesn't GWTP allow Object (created by us) to pass through ActionHandler?

Ok, Here is the scenarios.

I have: in myproject.client package. in myproject.client package. in myproject.client package. in myproject.shared package. in myproject.shared package.

all these files were automatically generated by eClipse except which were created by myself. user can enter customer attributes into textbox & click button then the system should search customers that match the attributes provided. to hold customer attributes such as setCustomerName & getCustomerName, setEmail.. etc has setCustomer(customer) & getCustomer(); // customer from shared package connect to Db & select name, email... then pass these info into Customer. Ex:


@Override  public GetCustomerResult execute(GetCustomer action, ExecutionContext context)              throws ActionException {      String sql="select name, email... from Customer...";      .....      String name=dbResults.getString(1);      Customer c =new Customer();      c.setName(name);      GetCustomerResult getCustomerResult=new GetCustomerResult();      getCustomerResult.setCustomer(c);      return getCustomerResult;    }  

But after ran, i got this err:

Starting Jetty on port 8888     [WARN] Exception while dispatching incoming RPC call Type 'myproject.shared.Customer' 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 = myproject.shared.Customer@31e4aa02      at      at  ......  

If we don't put data into object at server level then we have to put it at client level, but it will make the code cumbersome.

Maybe we can make Customer become Serialised or something like that... but i have no idea about that technique.

Why that happened? Do you know how to fix it? 

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment