Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 927923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:55:43+00:00 2026-05-15T19:55:43+00:00

I have a simple POJO mapped to a table using Hibernate. Which works just

  • 0

I have a simple POJO mapped to a table using Hibernate. Which works just fine.

public class Patient implements Serializable {

    private int    patientId;
    private String firstName;
    private String lastName;
    private Set<Prescription> patientPrescriptions;

    public Patient() {}

    ...
}

My problem is I want to be able to serialize the object so I can get it trough the wire for my GWT-RPC calls. If my async service return this object I get an error:

com.google.gwt.user.client.rpc.SerializationException: Type ‘org.hibernate.collection.PersistentSet’ 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 suppose this is due to the fact it cannot serialize Set since this is an interface hence not serializable. On the other hand Hibernate needs a collection interface (Set/Map) to work. So this means I can no longer send objects mapped with Hibernate? Is there some “easy” way to serialize a Set?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T19:55:44+00:00Added an answer on May 15, 2026 at 7:55 pm

    The problem is that GWT does not find the source code of the annotations and the used classes. GWT needs that source code since it has to compile your object into JS.

    I want to be able to serialize the
    object so I can get it trough the wire
    for my GWT-RPC calls.

    You can use Gilead to do that. (Previously known as Hibernate4GWT)

    I suppose this is due to the fact it
    cannot serialize Set since this is an
    interface hence not serializable. On
    the other hand Hibernate needs a
    collection interface (Set/Map) to
    work. So this means I can no longer
    send objects mapped with Hibernate? Is
    there some “easy” way to serialize a
    Set?

    The problem is not with Set, GWT can very well serialize collections through its GWT-RPC. Although during the transmission you will want to use a specific implementation like HashSet to allow it to optimize for that particular implementation, instead of a generic interface.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a spring mvc based application. I have a simple pojo form
My problem is, that I have simple Pojos or simply objects that contain data.
I have a controller in which I have a GET method display a form
Entity's are classes that map directly to our database (which we use for Hibernate).
I am using Hibernate with my Spring MVC project. Lets say my model has
hey, I have a deploy pojo plugin (deploying a war to a remote server).
I have a file(this file actually has tab separated values) which has to be
I am trying to upload files using Spring CommonsMultipartResolver however the controller is not
In my webapp, all my message converters are in place, and if I change
I've hit a blocker adding a fix to an existing project.the main problem is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.