Reputation: 2853
Getting
com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException:
Unrecognized field "operationMessage" (class worker.lib.message.OperationMessage), not marked as ignorable (9 known properties: "packageMessage", "sourceAsset", "operation", "publishMessage", "requestId", "remixMessage", "targetAsset", "jobId", "intermediates"])
at [Source: (String)"{"operationMessage":{"sourceAsset":{"path":"/a/b/c.txt","repoId":"testId","region":"va6"},"targetAsset":{"path":"/folder4","repoId":"id2","region":"va6"},"jobId":"7c540211d1054442940211d10594426e","intermediates":false}}"; line: 1, column: 22] (through reference chain:
worker.lib.message.OperationMessage["operationMessage"])
My OperationMessage Class is
@JsonInclude(JsonInclude.Include.NON_NULL)
@Data //generates getter and setters
public class OperationMessage {
@JsonProperty(value = "jobId")
private String jobId;
@JsonProperty(value = "operation")
private Operation operation;
@JsonProperty(value = "intermediates")
private Boolean intermediates; //for copy-move
private AssetProperties sourceAsset;
private AssetProperties targetAsset;
private PublishMessage publishMessage; //fields related to publish Operation.
private RemixMessage remixMessage; //fields related to remix Operation.
private PackageMessage packageMessage;//fields related to package Operation
private String requestId;
@Override
public String toString() {
return "OperationMessage [jobId=" + jobId + ", operation=" + operation + "]";
}
}
Can someone suggest what is the issue here?
Upvotes: 0
Views: 613
Reputation: 1112
Some things you should do are the following:
1) Add getters & setters for the member variables of your class
2) Add a default constructor public class OperationMessage { }
3) Implement the Serializable
public class OperationMessage implements Serializable
4) Add the @JsonIgnoreProperties(ignoreUnknown = true)
annotation to your POJO
Upvotes: 1
Reputation: 746
You don't have getters and setters... Or change these fields to be public.
Upvotes: 0