1

Google endpoint message objects are very simple POJOs. I have a compound POJO that used to work but now is no longer working. The error I am getting, when android client makes the call, is that the JSON cannot be parsed because of AnimalTag. Here are the POJOs. To migrate to Java 7, I copied and pasted the code manually. So I thought that could have been the cause, that perhaps I left something out. But I can't think of what the problem may be. Other calls work fine. But this one keeps failing.

The usage is that the method receives Dog from client to save on server. Not all the data in Dog is filled, but many, including AnimalTag, are filled. Also, AnimalTag only has the manufacturer filled. Again This all used to work.

public class Dog {

    private String name;
    private String owner;
    private AnimalTag tag;

    public Dog(String name, String owner, AnimalTag tag) {
      super();
      this.name = name;
      this.owner = owner;
      this.tag = tag;
  }

    public String getName() {
        return this.name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getOwner() {
        return this.owner;
    }
    public void setOwner(String owner) {
        this.owner = owner;
    }
    public AnimalTag getTag() {
        return this.tag;
    }
    public void setTag(AnimalTag tag) {
        this.tag = tag;
    }

}


class AnimalTag{
    private long number;
    BlobKey imageKey;
    String manufacturer;

    public AnimalTag(long number, BlobKey imageKey, String manufacturer) {
      super();
      this.number = number;
      this.imageKey = imageKey;
      this.manufacturer = manufacturer;
  }

    public long getNumber() {
        return this.number;
    }
    public void setNumber(long number) {
        this.number = number;
    }
    public BlobKey getImageKey() {
        return this.imageKey;
    }
    public void setImageKey(BlobKey imageKey) {
        this.imageKey = imageKey;
    }
    public String getManufacturer() {
        return this.manufacturer;
    }
    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }
}
user3093402
  • 1,419
  • 4
  • 20
  • 28

1 Answers1

0

I got the answer, AnimalTag was missing the following constructor:

public AnimalTag(){}
user3093402
  • 1,419
  • 4
  • 20
  • 28