我正在尝试使用此代码
在我的域类中设置当前日期private LocalDate createdUTC = LocalDate.now(Clock.systemUTC());
我没有任何针对此属性的setter只有getter。当我通过 RestTemplate 向我的控制器发送请求时,我收到此错误
{
"responseCode": 500,
"responseText": "Could not read document: Can not construct instance of java.time.LocalDateTime: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)\n at [Source: java.io.PushbackInputStream@6bde8de2; line: 1, column: 352] (through reference OrganizationResponse[\"createdUTC\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: Can not construct instance of java.time.LocalDateTime: no suitable constructor found, can not deserialize from Object value (missing default constructor or creator, or perhaps need to add/enable type information?)\n at [Source: java.io.PushbackInputStream@6bde8de2; line: 1, column: 352] (through reference chain: OrganizationResponse[\"createdUTC\"])"
}