Yes this should work in that environment (that is, using those versions of Spring and Jackson!). When faced with a mystery error like that my go-to is to crank up the log settings to TRACE for whatever library is failing.
I set up this example in my IDE (using Spring4 and Jackson2 as you are), and I immediately encountered a 400 "bad request" error as well. I cranked up the debug settings on org.springframework.web and com.fasterxml.jackson.core to find that Jackson2 was spitting out an exception:
com.fasterxml.jackson.databind.JsonMappingException: Can not deserialize instance of ca.ted.TestController$Person[] out of START_OBJECT token
This was because of the JSON being fed to the jQuery.ajax() call. I removed the "persons":{} object wrapping the array and sent only the array instead:
var arr = [
{
"firstName" : "Ramesh",
"id" : "id1",
"lastName" : "Kotha"
},
{
"firstName" : "Sathish",
"id" : "id2",
"lastName" : "Kotha"
}
];
I did this but encountered the following exception:
com.fasterxml.jackson.databind.JsonMappingException: No suitable constructor found for type [simple type, class ca.ted.TestController$Person]: can not instantiate from JSON object (need to add/enable type information?)
Turns out this was because Person was an inner class in my Controller. I moved it out to its own file, ca.ted.Person and all was well.
Hope this helps!
dataType: 'json',