【发布时间】:2017-01-21 14:14:33
【问题描述】:
我试图在我的 Spring MVC 3 应用程序中返回一个 JSON,但它对 Joda DateTimeFormatter 失败了
com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class org.joda.time.format.DateTimeFormat$StyleFormatter and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: java.util.HashMap["personDay"]->mypackage.PersonDay["dateTimeFormatter"]->org.joda.time.format.DateTimeFormatter["parser"])
看起来我可能需要一个自定义序列化程序,但我不确定从哪里开始。
【问题讨论】:
-
看this的帖子了吗
标签: java json api serialization jodatime