0
I am using Spring Boot on my API. Spring has the ability to convert Javabeans automatically to Jsons when returning an object.
However, with this code (in my MODEL layer) I am having a Classcastexception.
public InfosUserLogado listaUsuarioLogado(TokenApp tokenApp) {
ResponseEntity<InfosUserLogado> responseEntity = requester.doRequest(tokenApp, Constants.USER_AUTHENTICATED_URL, HttpMethod.GET, null);
return responseEntity.getBody();
}
java.lang.Classcastexception: java.lang.String cannot be cast to me.package.toolsapi.model.users.pojo.Infosuserloaded
Check if your method or controller has the annotation
@ResponseBody
– nullptr
It has the annotation, yes.
– FearX