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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:58:22+00:00 2026-06-11T02:58:22+00:00

I have an object A which extends object B when object A gets serialized

  • 0

I have an object “A” which extends object “B” when object “A” gets serialized the fields from object “B” do not get serialized into JSON. Any Ideas? Here are my objects involved.

public class CreateNewPlayerAndLoginResponse extends EPNetResponse{
    private PlayerSession playerSession;

    public CreateNewPlayerAndLoginResponse() {
    }

    public CreateNewPlayerAndLoginResponse(Integer playerId, String playerSessionId) {
        this.playerSession = new PlayerSession(playerId, playerSessionId);
    }

    public CreateNewPlayerAndLoginResponse(EPNetErrorEnum error) {
        super(error);
    }

    public CreateNewPlayerAndLoginResponse(EPNetError error) {
        super(error);
    }

    public PlayerSession getPlayerSession() {
        return playerSession;
    }

    public void setPlayerSession(PlayerSession playerSession) {
        this.playerSession = playerSession;
    }

    @Override
    public String toString() {
        return "CreateNewPlayerAndLoginResponse{" + "playerSession=" + playerSession + '}';
    }

}

public class EPNetResponse implements Serializable{

    private EPNetError error;

    public EPNetResponse() {
    }

    public EPNetResponse(EPNetError error) {
        this.error = error;
    }

    public EPNetResponse(EPNetErrorEnum error){
        this.error = new EPNetError(error);
    }

    public EPNetError getError() {
        return error;
    }

    public void setError(EPNetError error) {
        this.error = error;
    }

    @JsonIgnore
    public boolean isError(){
        if(error == null){
            return false;
        }

        return true;
    }
}

public class EPNetError implements Serializable{
    private static final int UNEXPECTED_ERROR = 5417;
    private Integer code;
    private String message;

    public EPNetError() {
    }

    public EPNetError(EPNetErrorEnum error){
        this.code = error.getCode();
        this.message = error.getMessage();
    }

    public EPNetError(EPNetErrorEnum error, String message){
        this.code = error.getCode();
        this.message = message;
    }

    public EPNetError(String message){
        this.code = EPNetError.UNEXPECTED_ERROR;
        this.message = message;
    }

    public EPNetError(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

}

All I get as the serialized response is

{"playerSession":null}

Even though I am 100% sure there is an error message part of the object before serialization.

Also worth mentioning I am using Jackson 1.9.2 and Jersey 1.13

  • 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-11T02:58:24+00:00Added an answer on June 11, 2026 at 2:58 am

    If you are expecting ‘error’ to be included, problem is that @JsonIgnore in isError(), without any other annotations. So, add @JsonProperty next to getError() and it should be included. You may also need to add it to setError().

    The problem here is that Jackson consider @JsonIgnore here to mean “ignore property ‘error'”, whereas you are probably only hoping to ignore that particular accessor.

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

Sidebar

Related Questions

I currently have a JSON object on my page which gets built up as
Using Flex 3.2, I have a object which extends a TitleWindow. In this TitleWindow
I have an ActiveX object which extends some functions. I have a web page
I have a question. I first created an object which extends NSObject, I provided
I have an interceptor which extends the HandlerInterceptorAdapter . When I add an object
I have object A which contains multiple instances of object B, which in turn
I have this object which is an instance of a superclass. I want to
I have an object which contains models for my ASP.NET MVC web app. The
I have an object which has several properties that are set when the object
I have an object which needs to destroy itself. Can it be done? 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.