When I try to post new object with post method. RequestBody could not recognize contentType. Spring is already configured and POST could work with others objects, but not this specific one.
org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported
If I try the same request just changing requestbody object. It works.
Best Answer
I found solution. It's was because I had 2 setter with same name but different type.
My class had id property int that I replaced with Integer when à Hibernitify my object.
But apparently, I forgot to remove setters and I had :
When I removed this setter, rest resquest work very well.
Intead to throw unmarshalling error or reflect class error. Exception HttpMediaTypeNotSupportedException seams really strange here.
I hope this stackoverflow could be help someone else.
SIDE NOTE
You can check your Spring server console for the following error message:
Then you can be sure you are dealing with the issue mentioned above.