mahesh chinta
mahesh chinta

Reputation: 41

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `javax.activation.DataHandler

`@JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public class MyDocumentServiceResponse {

@JsonProperty("Status")
protected String status;

@JsonProperty("DocumentClassName")
protected String documentClassName;

@JsonProperty("FileName")
protected String fileName;

@JsonProperty("MimeType")
protected String mimeType;

@JsonProperty("DocumentContent")
@JsonIgnore
protected DataHandler documentContent;

I am trying to fetch the response via HTTPPost call and able to retrieve the response but getting

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of \`javax.activation.DataHandler at below line

MyDocumentServiceResponse response = objectMapper.readValue(serviceResponse.getMessage(), MyDocumentServiceResponse.class);\

Please advise me how to fix this, I've tried all the possible ways but no luck.

Upvotes: 0

Views: 45

Answers (0)

Related Questions