是否有一个版本的restlet.ext.jackson来解析jsr310 LocalDateTime?

时间:2017-04-05 22:28:33

标签: java json restlet jsr310

想知道是否有办法使restlet jackson扩展来解析jsr310 LocalDateTime?目前它( RESTlet 版本2.3.9)抛出此异常:

... com.fasterxml.jackson.databind.JsonMappingException: 
No suitable constructor found for type [simple type, class java.time.LocalDateTime]: can not instantiate from JSON object (need to add/enable type information?)
 at [Source: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@1a3869f4; line: 1, column: 52] (through reference chain ...

这个问题与jackson无关 - 它确实消化了jsr310数据类型( jackson-modules-java8 ) - 问题是关于基于jackson的restlet扩展。

我可以看到我的服务器( restlet 2.3.9 )将其作为JSON发送:

...,
"startTime":{"monthValue":4,"year":2017,"month":"APRIL","dayOfMonth":6,"dayOfWeek":"THURSDAY","dayOfYear":96,"hour":10,"minute":1,"second":4,"nano":836000000,"chronology":{"id":"ISO","calendarType":"iso8601"}},
...

但是同样的 restlet 2.3.9 -built客户端无法解析此...

谢谢!

0 个答案:

没有答案