Hi Issac I am using Hibernate to deal with the persistent layer, that is why I need to serialize both the beans.
I had tried changing the default constructor of both the classes to Public but issue does not solved yet. Raul On Jun 16, 7:36 pm, Isaac Truett <[email protected]> wrote: > Raul, > > The problem is that you aren't actually serializing > com.data.employee.Department. Something is replacing your class with > com.data.employee.Department_$$_javassist_0. You wouldn't happen to be > using Hibernate, would you? > > - Isaac > > On Tue, Jun 16, 2009 at 7:10 AM, Raul<[email protected]> wrote: > > > Hello all, > > > I have two beans as follows: > > ----------------------------------------- > > public class employee implements IsSerializable{ > > > int id; > > String name; > > Department department; > > > public employee(){} > > public employee (int id, String name, Department dept){ > > setId(id); > > setName(name); > > setDepartment(dept); > > } > > > public void setId(int id){this.id=id;} > > public int getId(){return this.id;} > > > public void setName(String name){this.name=name;} > > public String getName(){return this.name;} > > > public void setDepartment(Department dept){this.department=dept;} > > public Department getDepartment(){return this.department;} > > > } > > ------------------------------------------ > > public class Department implements IsSerializable{ > > int dept_id; > > String name; > > > Department(){} > > public Department(int id, String name, String status){ > > setDept_id(id); > > setName(name); > > } > > > public void setDept_id(int dept_id){this.dept_id=dept_id;} > > public int getDept_id(){return this.dept_id;} > > > public void setName(String name){this.name=name;} > > public String getName(){return this.name;} > > > } > > > And when I try to use a Grid to hold Employee records I am having > > Error message like: > > > SEVERE: Exception while dispatching incoming RPC call > > com.google.gwt.user.client.rpc.SerializationException: > > java.lang.reflect.InvocationTargetException > > at > > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer > > (ServerSerializationStreamWriter.java:696) > > at > > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeImpl > > (ServerSerializationStreamWriter.java:659) > > at > > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize > > (ServerSerializationStreamWriter.java:593) > > ......................... > > ......................... > > ......................... > > .......................... > > Caused by: java.lang.reflect.InvocationTargetException > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > > at java.lang.reflect.Method.invoke(Unknown Source) > > at > > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serializeWithCustomSerializer > > (ServerSerializationStreamWriter.java:678) > > ... 24 more > > > Caused by: com.google.gwt.user.client.rpc.SerializationException: Type > > 'com.data.employee.Department_$$_javassist_0' 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. > > at > > com.google.gwt.user.server.rpc.impl.StandardSerializationPolicy.validateSerialize > > (StandardSerializationPolicy.java:83) > > at > > com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.serialize > > (ServerSerializationStreamWriter.java:591) > > at > > com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.writeObject > > (AbstractSerializationStreamWriter.java:129) > > at > > com.google.gwt.user.client.rpc.core.java.util.Collection_CustomFieldSerializerBase.serialize > > (Collection_CustomFieldSerializerBase.java:43) > > at > > com.google.gwt.user.client.rpc.core.java.util.ArrayList_CustomFieldSerializer.serialize > > (ArrayList_CustomFieldSerializer.java:36) > > ... 29 more > > > What I am guessing as the reason for this error is - it may due to > > using a Serialised object variable(Department) inside another > > Serialized object bean (Employee). > > > I am not sure .... > > need help. > > > Kindly put some suggestions, how can I overcome this issue...!! > > > Also doesn't GWT allow a Serialized bean object variable in another > > serialized Bean class..?? > > > your kind suggestions will be highly appreciable.. > > > Raul --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
