Buggy code:
@ Controller public class CommentController { @ Autowired MongoTemplate db ; @ RequestMapping ( method = RequestMethod . POST , value = "//rest//comment//app//{app}//add" ) @ ResponseBody public boolean addCommento ( HttpServletRequest request , @ RequestBody String messageToMediationService , @ PathVariable String app ) { } private ContentToModeratorService valueOf ( String json ) { try { JSONObject o = new JSONObject ( json ) ; String webapp = o . getString ( "webappname" ) ; String entityTesto = o . getString ( "objectText" ) ; String userid = o . getString ( "userid" ) ; String entityId = o . getString ( "objectId" ) ; ContentToModeratorService messageToMediationService = new ContentToModeratorService ( webapp , entityId , entityTesto , userid ) ; messageToMediationService . setManualApproved ( State . valueOf ( o . getString ( "manualApproved" ) ) ) ; messageToMediationService . setKeywordApproved ( o . getBoolean ( "keywordApproved" ) ) ; messageToMediationService . setTimestamp ( o . getLong ( "timestamp" ) ) ; if ( o . has ( "note" ) ) <START_BUG> messageToMediationService . setNote ( o . getString ( "note" ) ) ; <END_BUG> return messageToMediationService ; } catch ( JSONException e ) { return null ; } } @ RequestMapping ( method = RequestMethod . GET , value = "//rest//comment//local//{app}//all" ) @ ResponseBody public List < ContentToModeratorService > getCommentoPA ( HttpServletRequest request , @ PathVariable String app ) { } @ RequestMapping ( method = RequestMethod . GET , value = "//rest//comment//remote//{app}//all" ) @ ResponseBody public List < ContentToModeratorService > getCommentoMA ( HttpServletRequest request , @ PathVariable String app ) { } @ RequestMapping ( method = RequestMethod . POST , value = "//rest//comment//{_id}//app//{app}//note//add" ) @ ResponseBody public boolean addNote ( HttpServletRequest request , @ PathVariable String _id , @ PathVariable String app , @ RequestBody String note ) { } @ RequestMapping ( method = RequestMethod . PUT , value = "//rest//comment//{_id}//app//{app}//mediationapproved//change//{stato}" ) @ ResponseBody public boolean changeMediationApproved ( HttpServletRequest request , @ PathVariable String app , @ PathVariable String _id , @ PathVariable String stato ) { } @ RequestMapping ( method = RequestMethod . GET , value = "//rest//comment//data//{data}//{app}" ) @ ResponseBody public List < ContentToModeratorService > exportComment ( HttpServletRequest request , @ PathVariable String app , @ PathVariable long data ) { } @ RequestMapping ( method = RequestMethod . GET , value = "//rest//content//id//{identity}//{app}" ) @ ResponseBody public List < ContentToModeratorService > getContentById ( HttpServletRequest request , @ PathVariable String app , @ PathVariable String identity ) { } @ RequestMapping ( method = RequestMethod . GET , value = "//rest//content//from//{fromdata}//to//{todata}//{app}" ) @ ResponseBody public List < ContentToModeratorService > getContentById ( HttpServletRequest request , @ PathVariable String app , @ PathVariable long fromdata , @ PathVariable long todata ) { } @ RequestMapping ( method = RequestMethod . DELETE , value = "//rest//content//id//{identity}//{app}" ) @ ResponseBody public void deleteContentById ( HttpServletRequest request , @ PathVariable String app , @ PathVariable String identity ) { } }

Fix:
messageToMediationService . setNote ( o . optString ( "note" , null ) ) ;