对象条目内/之间的意外输入结束

问题描述 投票:0回答:1

我从字面上试图从表中获取实体并将其显示在页面中。很简单的东西。但我一直收到此异常

    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();

}

任何人都知道为什么我会收到此错误? Thx

java json spring spring-boot
1个回答
0
投票

您能够找到解决方法吗?或是什么原因造成的?

© www.soinside.com 2019 - 2024. All rights reserved.