I have tried searching for the answer to this question at many resources including this web site. There are lot of questions about this exception, but I believe this is related to spring version upgrade.
We are attempting to upgrade to Spring version 4.3.5.RELEASE from 4.2.5.RELEASE. No compilation issues and most of the pieces of application work fine.
We noticed that many (but not all) @ResponseBody services are broken after the upgrade. I am still trying to find out why it works in some cases.
Example error message as follows
Caused by: com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class java.util.HashMap and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.HashMap["result"])
Just changing back to original spring version again, makes the service work.
What should we do to make service work on newer version of spring?
[Additional information after some more experiments]
Method had a signature which worked in 4.2.5, but fails in 4.3.5
public Map<String, Serializable> myMethod()
After changing it to follows - replacing Serializable with Object, it works in 4.3.5
public Map<String, Object> myMethd()