You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MessagePack cannot serialize a BigDecimal that can't be represented as double. 0.00001 #534
ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory());
OrderEntity orderEntiy = new OrderEntity();
orderEntity.setAmount(new BigDecimal("0.00001"));
byte[] bytes = objectMapper.writeValueAsBytes(orderEntity);
public class OrderEntity {
private BigDecimal amount;
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
}
error:
MessagePack cannot serialize a BigDecimal that can't be represented as double. 0.00001
java.lang.IllegalArgumentException: MessagePack cannot serialize a BigDecimal that can't be represented as double. 0.00001
at org.msgpack.jackson.dataformat.MessagePackGenerator.packBigDecimal(MessagePackGenerator.java:274)
at org.msgpack.jackson.dataformat.MessagePackGenerator.pack(MessagePackGenerator.java:233)
at org.msgpack.jackson.dataformat.MessagePackGenerator.packObject(MessagePackGenerator.java:291)
at org.msgpack.jackson.dataformat.MessagePackGenerator.flush(MessagePackGenerator.java:520)
at org.msgpack.jackson.dataformat.MessagePackGenerator.close(MessagePackGenerator.java:504)
at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4414)
at com.fasterxml.jackson.databind.ObjectMapper.writeValueAsBytes(ObjectMapper.java:3687)
Activity
komamitsu commentedon Dec 17, 2020
@hudingchen Thanks for reporting this issue. I fixed it in #540.