This question is very similar to this SO problem which is for older Date
API.
I want to achieve the same with Java 8 LocalDateTime
API. When I do,
@RequestMapping("/locationSnapshot/{userId}/{pointInTime}")
public MyResponse getLocationInTime(
@PathParam(value="userId") Long userId,
@PathParam(value="pointInTime")
@DateTimeFormat(pattern="yyyy-MM-dd'T'HH:mm:ss") LocalDateTime pointInTime) {
MyResponse response = new MyResponse();
return response;
}
I get,
Failed to instantiate [java.time.LocalDateTime]: No default constructor
found; nested exception is java.lang.NoSuchMethodException:
java.time.LocalDateTime.<init>()