小编Yio*_*our的帖子

Jakson 无法从 START_OBJECT 令牌反序列化 java.util.ArrayList 的实例

发送 POST 后,我收到 400 错误 curl localhost:8888/bills/addbill -H "Content-Type: application/json" -X POST -d '{"number":"111A111", "customer":"Customer Cuustomer Rrrr", "phone":"1 800 5551212", "manager":"Manager Manager Manager", "date":"2012-09-17", "curId":{"id":"1"}, "payments":{["id":"1"]}}'

回应是: {"timestamp":1503684882518,"status":400,"error":"Bad Request","exception":"org.springframework.http.converter.HttpMessageNotReadableException","message":"Bad Request","path":"/bills/addbill"}

当我尝试反序列化我的 json 数据时出现异常。如何正确反序列化 JSON?

账单实体文件是:

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import ru.test.practice.view.PaymentView;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@Entity
@Table(name = "Bill")
public class Bill {

    @GeneratedValue
    @Id
    @Column(name = "id")
    private Integer id;

    @Version
    private int version;

    @Column(name = "number")
    @NotNull(message = "Num should be set") …
Run Code Online (Sandbox Code Playgroud)

java spring hibernate spring-mvc jackson

5
推荐指数
1
解决办法
2万
查看次数

intellij idea中整个项目的UML图

如何在intellij idea中获得项目中所有类的图表?

uml intellij-idea

5
推荐指数
1
解决办法
5374
查看次数

Apache POI。style.setBackgroundColor不起作用

Workbook workbook = new HSSFWorkbook();
Sheet worksheet = workbook.createSheet("test sheet");
Row row1 = worksheet.createRow(0);
Cell cell0  = row1.createCell(0);
CellStyle testStyle = workbook.createCellStyle();
testStyle.setFillBackgroundColor(IndexedColors.RED.getIndex());
cell0.setCellStyle(testStyle);
Run Code Online (Sandbox Code Playgroud)

我正在尝试将单元格的背景颜色更改为红色。但是实际上单元格的背景颜色没有改变。还是白的

java apache-poi

0
推荐指数
1
解决办法
307
查看次数

标签 统计

java ×2

apache-poi ×1

hibernate ×1

intellij-idea ×1

jackson ×1

spring ×1

spring-mvc ×1

uml ×1