Header Ad

Thursday, August 16, 2018

Caused by: java.lang.IllegalArgumentException: Conflicting setter definitions for property "AttributeStatus": com.pkj.Clazz#setAttributeSource(1 params) vs com.pkj.Clazz#setAttributeStatus(1 params)


Symptoms :

  1. You are using com.fasterxml.jackson.databind ObjectMapper
  2. By using object of ObjectMapper you are possibly trying Convert Json to POJO
  3. All problem lies in your POJO class
Solution:
  1.  Go to your POJO class i.e. Clazz in my case
  2. checkout the property or variable named "AttributeStatus"
  3. In my case  I had added   @JsonProperty("AttributeSource") on two properties or variables
  4. So corrected that and it worked, meaning I had put correct @JsonProperty on respective variables.
i.e. 

 Before
     @JsonProperty("AttributeSource") 
      private String AttributeSource

     @JsonProperty("AttributeSource") 
      private String AttributeDestination

After

     @JsonProperty("AttributeSource") 
      private String AttributeSource

     @JsonProperty("AttributeDestination") 
      private String AttributeDestination

Help more people:- Share this link, comment if you have any suggestion.




No comments:

Post a Comment