このクラスで:
public class Products implements Serializable {
private BigDecimal productId;
private float priority;
public float getPriority() {
return priority;
}
public void setPriority(float priority) {
this.priority = priority;
}
}
このような JSON データの逆シリアル化を行う場合:
{"productId":47552,"priority":78}
このエラーが発生しました:
org.codehaus.jackson.map.JsonMappingException:
Can not deserialize instance of float out of FIELD_NAME token
at [Source: org.apache.catalina.connector.CoyoteInputStream@103cf49; line: 1, \
column: 290] (through reference chain: entity.Products["priority"])
ただし、このデータの場合 (優先度の値を引用符で囲みます)
{"productId":47552,"priority":"78"}
うまく動作するので、jackson (1.9.9) は数値を尊重していないようです。ここで何かがおかしいと思います。