The serialization of inner classes works fine if the inner-class definition is in the same class.
This works:
<pre>
static class Person{
public String name;
public Address address = new Address();
class Address{
public String city;
public Address({
}
}
}
</pre>
But deserialization of a the subclass of person fails.
<pre>
static class Person2
extends Person{
public Address address2 = new Address();
}
</pre>
The fail message is:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `Test$Person$Address`: non-static inner classes like this can only by instantiated using default, no-argument constructor
Anybody knows how to fix this problem? (I do not want to create a static inner class though)