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

  • Home
  • SEARCH
  • 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 6898757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:20:13+00:00 2026-05-27T07:20:13+00:00

I have a class Data which implements Serializable interface. This class has such fields

  • 0

I have a class Data which implements Serializable interface. This class has such fields

    private boolean q = false;
    private String a = "";
    private List<Someclass> m = Collections.emptyList();
    private List<Object[]> d = Collections.emptyList();

Values assigned to these members are default values. Class Someclass also implements Serializable and it has such columns

   private Types sqlType;
    private int columnWidth;
    private String columnName;

Types is an enum which also implements serializable.

In Data class I have List<Object[]> d in which I will save data fethced from database through jdbc(when iterating ResultSet i use getObject() method). I use such construction, because it can run any query(query’s structure is not known). In List<Someclass> m I hold metada of query. So when I try to fetch rows with simple query I get

com.google.gwt.user.client.rpc.SerializationException: Type '[Ljava.lang.Object;' 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 = [Ljava.lang.Object;@127053a9

Why it occures? All my transfer objects are serializable.

edit
Ok, Object is not Serializable so it can not be passed to and returned from the server. But what I should use in this case. Generics will not help me, because I don’t know the type at compile time

  • 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-27T07:20:14+00:00Added an answer on May 27, 2026 at 7:20 am

    In order for the class to be serializable, essentially everything you can get to from it has to also be serializable. In this case Object is not serializable, which makes Object[] not serializable, which makes List not serializable, which makes Data not serializable.

    Think about it this way: If you can’t serialize a given Object in the Object[], how are you going to serialize the Object[]? And if you can’t serialize that, how are you going to serialize a list of that? And if you can’t serialize that list, how are you going to serialize something that contains that list?

    Now, it could be that everything in your Object[] ends up being serializable — but the way you’ve typed it, the compiler can’t guarantee that.

    EDIT: Regarding what you should use instead, I would create some sort of wrapper class that will hold the SQL query’s results, and make that one serializable.

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

Sidebar

Related Questions

Let's say I have a class that has a member called data which is
I have a class that contains data from some model. This class has metadata
I have a particular class that stores a piece of data, which implements an
I have a data structure which is as given below: class File { public
I have a project for my Data Structures class, which is a file compressor
Using DBIx::Class and I have a resultset which needs to be filtered by data
I have a class MyClass that has a static variable. Class implements smth like
I have a class which implements UITableViewDelegate protocol and there is another class which
I have a simple question. I use a singleton which implements an abstract class.
I have a custom model, which internally uses HashMap<String, Object> to store the data.

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.