“Content type ‘application/json;charset=UTF-8’ not supported” in Spring Rest application

We Are Going To Discuss About “Content type ‘application/json;charset=UTF-8’ not supported” in Spring Rest application. So lets Start this Java Article.

“Content type ‘application/json;charset=UTF-8’ not supported” in Spring Rest application

  1. “Content type 'application/json;charset=UTF-8' not supported” in Spring Rest application

    In my case there was a Jackson fail, logged as a WARN:
    Failed to evaluate Jackson deserialization for type [[simple type, class ***]]: com.fasterxml.jackson.databind.JsonMappingException: Conflicting setter definitions for property [...]
    I had overloaded a setter by accident, so it could not be resolved by Jackson and spring has thrown 415.

  2. “Content type 'application/json;charset=UTF-8' not supported” in Spring Rest application

    In my case there was a Jackson fail, logged as a WARN:
    Failed to evaluate Jackson deserialization for type [[simple type, class ***]]: com.fasterxml.jackson.databind.JsonMappingException: Conflicting setter definitions for property [...]
    I had overloaded a setter by accident, so it could not be resolved by Jackson and spring has thrown 415.

Solution 1

I was able to solve it by removing @JsonManagedReference.

Original Author edited Jun 10, 2020 at 8:23 Of This Content

Solution 2

In my case there was a Jackson fail, logged as a WARN:

Failed to evaluate Jackson deserialization for type [[simple type, class ***]]: com.fasterxml.jackson.databind.JsonMappingException: Conflicting setter definitions for property [...]

I had overloaded a setter by accident, so it could not be resolved by Jackson and spring has thrown 415.

Original Author Klaudia Of This Content

Solution 3

You can try something like

@PostMapping(value="/rest/account/json", consumes={"application/json"})

Original Author Sajan Chandran Of This Content

Solution 4

You specified content-type = application/json. I think you may have to check also “Accept” Header property (application/json)

postman screenshot

Original Author Respect Pub Of This Content

Conclusion

So This is all About This Tutorial. Hope This Tutorial Helped You. Thank You.

Also Read,

Siddharth

I am an Information Technology Engineer. I have Completed my MCA And I have 4 Year Plus Experience, I am a web developer with knowledge of multiple back-end platforms Like PHP, Node.js, Python and frontend JavaScript frameworks Like Angular, React, and Vue.

Leave a Comment