Status 400 and Error deserializing List of Objects. No default constructor found

牧云@^-^@ 提交于 2019-12-02 10:55:56

Solved. Problem was I was using .queryparam without key-value structure. So changing .queryparam(mail) to .queryparam("mail", mail) solved it.

Try to test with this :

   @RestController
    public class Controller {

    @Autowired
    private MessageRepository daoMsg;

    @RequestMapping(value = "/Mensajes", method = RequestMethod.GET, produces=MediaType.APPLICATION_JSON_VALUE)
    @ReponseBody
    public ResponseEntity<List<MessageObject>> enviados (@RequestParam("mail") String mail) {
        return new ResponseEntity<>(daoMsg.findByEmisorOrDestinatario(mail, mail), HttpStatus.OK);  

    } 
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!