gwt-jackson: Failing to instantiate interface Type
So I have a situation coming from GWT RPC serialization. GWT allowed you to provide an interface type as a return type and then you return an object that implements that interface. It appears gwt-jackson doesn’t offer this kind of deserialization?
I have an interface called ProcessPageData which has 2 implementors:
- OpenIncidentData
- InvestigationData
Unable to deserialize response. An unexpected error occurred.
Cannot instantiate the type nz.co.doltech.ims.shared.core.ProcessPageData`
Depending on the process that is being loaded it returns the appropriate data in the form of the class. This worked fine previously and I would love to know how this could be done with jackson.
Cheers! (Also, sorry I don’t know where else to post questions that I have 😄)
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 18 (9 by maintainers)
Your fields are private and your constructor isn’t annotated with @JsonCreator nor the parameters with @JsonProperty. So it means, gwt-jackson uses the default constructor (even if private) and it does not find any property because there is no setter or accessible property (getters does not count in deserialization).
If you want to keep your object without setter, you can