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 9124779
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:38:36+00:00 2026-06-17T06:38:36+00:00

I have a problem in that my class does not serialize, instead GWT RPC

  • 0

I have a problem in that my class does not serialize, instead GWT RPC returns null every single time. I am trying to send objects of type Test through RPC. This is my class:

public class Test implements Serializable {
    /**
     * 
     */
    private static final long serialVersionUID = 2857617541722878389L;
    private int testID;
    private String testName;
    private String testTheme;
    private String subject;
    private int questAmount;
    private long created;
    private int timer;

    /**
     * @gwt.typeArgs <com.nimeria.client.TestCell>
     */
    private ArrayList<TestCell> tasks = new ArrayList<TestCell>();

    public Test(String testName) {
        super();
        this.testName = testName;
    }

    public Test(String testName, String testTheme) {
        super();
        this.testName = testName;
        this.testTheme = testTheme;
    }

    public Test(int testID, String testName, String testTheme, int questAmount,
            ArrayList<TestCell> tasks) {
        super();
        this.testID = testID;
        this.testName = testName;
        this.testTheme = testTheme;
        this.questAmount = questAmount;
        this.tasks = tasks;
    }

    public int getTimer() {
        return timer;
    }

    public void setTimer(int timer) {
        this.timer = timer;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public long getCreated() {
        return created;
    }

    public void setCreated(long created) {
        this.created = created;
    }

    public Test(int testID, String testName, String testTheme, String subject,
            int questAmount, long created, int timer) {
        this.created = created;
        this.testID = testID;
        this.testName = testName;
        this.testTheme = testTheme;
        this.questAmount = questAmount;
        this.timer = timer;
        this.subject = subject;
    }

    public Test() {
        // TODO Auto-generated constructor stub
    }

    public int getTestID() {
        return testID;
    }

    public void setTestID(int testID) {
        this.testID = testID;
    }

    public String getTestName() {
        return testName;
    }

    public void setTestName(String testName) {
        this.testName = testName;
    }

    public int getQuestAmount() {
        return questAmount;
    }

    public void setQuestAmount(int questAmount) {
        this.questAmount = questAmount;
    }

    /**
     * @gwt.typeArgs <com.nimeria.client.TestCell>
     */
    public ArrayList<TestCell> getTasks() {
        return tasks;
    }

    /**
     * @gwt.typeArgs tasks <com.nimeria.client.TestCell>
     */
    public void setTasks(ArrayList<TestCell> tasks) {
        this.tasks = tasks;
    }

    public String getTestTheme() {
        return testTheme;
    }

    public void amountIncrement() {
        this.questAmount++;
    }
}

public class TestCell implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 985354326237784028L;
    private int taskId;
    private String quest;
    private int qustionsAmount;
    private int rightAnswer;
    private int type;
    /**
     * @gwt.typeArgs <java.lang.String>
     */
    private ArrayList<String> qustions = new ArrayList<String>();

    public TestCell(int taskId, int qustionsAmount, int rightAnswer, int type) {
        super();
        this.taskId = taskId;
        this.qustionsAmount = qustionsAmount;
        this.rightAnswer = rightAnswer;
        this.type = type;
    }

    public TestCell(int taskId, int qustionsAmount, int type) {
        super();
        this.taskId = taskId;
        this.qustionsAmount = qustionsAmount;
        this.type = type;
    }

    public TestCell(int taskId, int qustionsAmount) {
        super();
        this.taskId = taskId;
        this.qustionsAmount = qustionsAmount;
    }

    public TestCell(int taskId, String quest, int qustionsAmount,
            int rightAnswer, int type, String q1, String q2, String q3,
            String q4, String q5) {
        this.taskId = taskId;
        this.quest = quest;
        this.qustionsAmount = qustionsAmount;
        this.rightAnswer = rightAnswer;
        this.type = type;
        this.qustions.add(q1);
        this.qustions.add(q2);
        this.qustions.add(q3);
        this.qustions.add(q4);
        this.qustions.add(q5);
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getTaskId() {
        return taskId;
    }

    public void setTaskId(int taskId) {
        this.taskId = taskId;
    }

    public String getQuest() {
        return quest;
    }

    public void setQuest(String quest) {
        this.quest = quest;
    }

    public int getQustionsAmount() {
        return qustionsAmount;
    }

    public void setQustionsAmount(int qustionsAmount) {
        this.qustionsAmount = qustionsAmount;
    }

    public int getQustionNumber() {
        return taskId;
    }

    public void setQustionNumber(int qustionNumber) {
        this.taskId = qustionNumber;
    }

    public int getRightAnswer() {
        return rightAnswer;
    }

    public void setRightAnswer(int rightAnswer) {
        this.rightAnswer = rightAnswer;
    }

    /**
     * @gwt.typeArgs <java.lang.String>
     */
    public ArrayList<String> getQustions() {
        return qustions;
    }

    /**
     * @gwt.typeArgs questions <java.lang.String>
     */
    public void setQustions(ArrayList<String> qustions) {
        this.qustions = qustions;
    }
}

And this is my RPC call:

conectModule.saveTest(t, new AsyncCallback<Integer>(){
    public void onFailure(Throwable caught) {
        Window.alert(caught.getMessage());
        Window.alert(caught.getLocalizedMessage());
    }

    public void onSuccess(Integer result) {
        Window.alert("Тест сохранен"+result);

        try {
            loadTestListing();
        } catch (Exception e) {
            e.printStackTrace();
        } 
    }
});
  • 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-06-17T06:38:38+00:00Added an answer on June 17, 2026 at 6:38 am

    Serializable classes must have a default (zero argument) constructor, i.e. Test() and TextCell().

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

Sidebar

Related Questions

I have a SimpleProducerConsumer class that illustrates a consumer/producer problem (I am not sure
I have the problem that my view controller class has too many delegates and
i have a problem calling multiple instance of a class that i have coded
I have a class that is mapped to a table using NHibernate. The problem
I am facing a problem. I have a Class that extends listactivity and its
Problem in words: For my application, I have a class that reads from a
My problem: require_once '/includes/aws-sdk-1.5.2/sdk.class.php'; My environment: I have a pretty standard PHP site that
Today I ran into the following problem with NUnit. I have a class, that
I have a problem that I'm working on for quite some time now. I
I have the problem that the query I use for finder_sql is not parsed

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.