我实际上是在尝试从表中获取实体并将其显示在页面中。很简单的东西。但是我一直收到这个例外
com.fasterxml.jackson.databind.JsonMappingException: Unexpected end-of-input within/between Object entries
at [Source: java.io.PushbackInputStream@27bef6cc; line: 1, column: 143900]
at [Source: java.io.PushbackInputStream@27bef6cc; line: 1, column: 135916] (through reference chain: com.myproject.integration.ws.common.response.GenericResponse["content"]->java.util.ArrayList[0])
这是我要显示的实体:
@Entity
@Table(name = "myTable")
@Data
public class PaliativoMetas implements Serializable {
@EmbeddedId
private PaliativoMetasPk id;
@Column(name = "INDIVIDUAL")
private Integer individual;
@Column(name="EQUIPE")
private Integer equipe;
@Column(name="GESTAO")
private Integer gestao;
@Column(name = "DIRETORIA")
private Integer diretoria;
@Column(name = "CORPORATIVA")
private Integer corporativa;
@Column(name = "TOTAL_O")
private Integer totalObj;
@Column(name = "STATUS")
private Boolean status;
@Column(name = "AV_COMP")
private Integer avComportamental;
@Column(name="AV_ASC")
private Integer avAsc;
@Column(name = "PARES")
private Integer pares;
@Column(name = "AUTO_AV")
private Integer autoAv;
@Column(name="TOTAL")
private Integer total;
public PaliativoMetas(){
}
public PaliativoMetas(PaliativoMetasPk id,Integer individual, Integer equipe, Integer gestao,Integer diretoria,Integer corporativa,Integer totalObj,Boolean status,Integer avComportamental, Integer pares, Integer autoAv, Integer total){
this.id = id;
this.individual = individual;
this.equipe = equipe;
this.gestao = gestao;
this.diretoria = diretoria;
this.corporativa = corporativa;
this.totalObj = totalObj;
this.status = status;
this.avComportamental = avComportamental;
this.autoAv= autoAv;
this.pares = pares;
this.total = total;
}
private BusinessUnits getBusinessUnits(){
return id.getEmployee().getIdBusinessUnit();
}
private BigDecimal getBusinessUnitsId(){
return getBusinessUnits().getIdBusinessUnit();
}
private String getNameEmployee(){
return id.getEmployee().getNameEmployee();
}
private String getManagerName(){
return id.getEmployee().getManager().getNameEmployee();
}
}
以下是进行数据库调用的方法:
@GetMapping(path="/filter1" ,produces = "application/json")
public @ResponseBody
ResponseEntity<GenericResponse> filter(){
List<PaliativoMetas> lista;
try{
lista = paliativoRepository.findAll();
}catch(Exception e){
throw new IntegrationException("Erro ao fazer a chamada para o banco");
}
GenericResponse response = new GenericResponse();
response.setContent(lista);
return ResponseEntity.status(HttpStatus.OK).body(response);
}
下面是调用此方法的控制器:
public List<PaliativoMetas> scoreFilter() throws Exception {
String url = myUrl
GenericResponse notas;
try {
notas = restTemplate.getForObject(url, GenericResponse.class);
} catch (Exception e) {
log.error(LOG_PREFIX + "-[HTTP STATUS][{}]-[ERROR][{}]-[RESPONSE]-[{}]", e.getMessage());
throw new Exception(e.getMessage());
}
return notas.getContent();
}
任何人都知道为什么我会收到此错误?谢谢