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)
--
You received this message because you are subscribed to the Google Groups
"jackson-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/jackson-user/a5d61614-2fea-4a91-b0ae-bc7fab23320dn%40googlegroups.com.