[KryoNet] Issue with static class

I have a Planet packet that I am sending from the server to the client.

The Planet.class contains this:

//Class implements Serializable
public PlanetType type;

public void init(PlanetType type){
    this.type = type;
}

The PlanetType.class contains:

//Class implements Serializable
public static PlanetType terra = new PlanetType("terra");
	
	public String name;
	
	public PlanetType(String name){
		this.name = name;
	}

I have registered both classes but when I send a Planet packet I get an: Error during deserialization error. Class cannot be created (missing no-arg constructor): com.gpg.pt.planet.PlanetType

So I assume I cannot have a constructor in the PlanetType.class. So can I not have a PlanetType variable in my Planet.class?

The error clearly states a lack of a default constructor, so why not try that?


public static PlanetType terra = new PlanetType("terra");
   
   public String name;
   
   public PlanetType(String name){
      this.name = name;
   }

+   public PlanetType() {
+      this(DEFAULT_NAME);
+   }