• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Still serialization problem with DTO

 
Mark Pereira
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey everyone.

I made DTOs to get over the serialization problem and still have the same error:
Caused by: com.google.gwt.user.client.rpc.SerializationException: Type 'com.client.ActivityDTO' 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 have the entities with annotations in a shared package (client and server) and have dtos in client side. I have an empty contructor in all entities and they are all serialized.

Can anybody help me? I am getting desperate with this.

Thanks, Mark
 
Maneesh Godbole
Saloon Keeper
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch.
Difficult to say without seeing any code. Could you please show us your ActivityDTO (Just make sure you UseCodeTags)
 
Mark Pereira
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey, thanks for your answer. Below I put the ActivityDTO class. I have this in client package like the others DTOs.
The entities but with hibernate annotations are in another package (shared), and when I make the query in server service class and return the object appears the serialization error.
Thanks for trying to help ;)

 
Maneesh Godbole
Saloon Keeper
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you got ComponentDTO ActivityLockDTO ActivityTypeDTO ActivityPermissionDTO inside your ActivityDTO.
Do all these DTOs implement Serializable and and an default constructor?

The entities but with hibernate annotations are in another package (shared)

I am not sure I understand this. Do your DTO have hibernate annotations?

 
Mark Pereira
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, all of my DTOs implement Serializable and have a no-args constructor.

My DTOs in client side dont have hibernate annotations, but entity classes in another package have, cause I need them.

I really dont know what to try more...

Maneesh Godbole wrote:So you got ComponentDTO ActivityLockDTO ActivityTypeDTO ActivityPermissionDTO inside your ActivityDTO.
Do all these DTOs implement Serializable and and an default constructor?

The entities but with hibernate annotations are in another package (shared)

I am not sure I understand this. Do your DTO have hibernate annotations?

 
Maneesh Godbole
Saloon Keeper
Posts: 10976
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Entities are the classes you get from Hibernate. They have hibernate related and other annotations.
DTOs are the POJOs which correspond with these Entities. DTOs are serializable and do not have any annotations.

Where are your entity classes? Under server?
Do you have a converter code or some other facility which converts Entity<->DTO?

Remember, everything under shared has to be serializable, and the source code should be available for the GWT compiler, including the source code for annotations.
 
Mark Pereira
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey! It works! I was doing everything fine but I dont know why Netbeans was not generating well rpc file I tried with Eclipse and it works, after using GWT Compiler.

Thanks for your attention,
Marco


Maneesh Godbole wrote:Entities are the classes you get from Hibernate. They have hibernate related and other annotations.
DTOs are the POJOs which correspond with these Entities. DTOs are serializable and do not have any annotations.

Where are your entity classes? Under server?
Do you have a converter code or some other facility which converts Entity<->DTO?

Remember, everything under shared has to be serializable, and the source code should be available for the GWT compiler, including the source code for annotations.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic