You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Caused by: java.time.format.DateTimeParseException: Text '2025-01-25 01:29:30' could not be parsed at index 19
at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2052) ~[?:?]
at java.base/java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1954) ~[?:?]
at java.base/java.time.LocalDateTime.parse(LocalDateTime.java:494) ~[?:?]
at com.alibaba.fastjson2.JSONReader.readLocalDateTime(JSONReader.java:1320) ~[fastjson2-2.0.54.jar:?]
at com.alibaba.fastjson2.reader.ObjectReaderImplLocalDateTime.readObject(ObjectReaderImplLocalDateTime.java:64) ~[fastjson2-2.0.54.jar:?]
at com.alibaba.fastjson2.reader.ORG_3_14_CreateSendMailTaskRequest.readObject(Unknown Source) ~[?:?]
at com.alibaba.fastjson2.JSON.parseObject(JSON.java:1655) ~[fastjson2-2.0.54.jar:?]
at com.alibaba.fastjson2.support.spring6.http.converter.FastJsonHttpMessageConverter.readType(FastJsonHttpMessageConverter.java:111) ~[fastjson2-extension-spring6-2.0.54.jar:?]
at com.alibaba.fastjson2.support.spring6.http.converter.FastJsonHttpMessageConverter.read(FastJsonHttpMessageConverter.java:80) ~[fastjson2-extension-spring6-2.0.54.jar:?]
at org.springframework.web.servlet.mvc.method.annotation.AbstractMessageConverterMethodArgumentResolver.readWithMessageConverters(AbstractMessageConverterMethodArgumentResolver.java:184) ~[spring-webmvc-6.1.15.jar:6.1.15]
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.readWithMessageConverters(RequestResponseBodyMethodProcessor.java:161) ~[spring-webmvc-6.1.15.jar:6.1.15]
at org.springframework.web.servlet.mvc.method.annotation.RequestResponseBodyMethodProcessor.resolveArgument(RequestResponseBodyMethodProcessor.java:135) ~[spring-webmvc-6.1.15.jar:6.1.15]
at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:122) ~[spring-web-6.1.15.jar:6.1.15]
at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:224) ~[spring-web-6.1.15.jar:6.1.15]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:178) ~[spring-web-6.1.15.jar:6.1.15]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:118) ~[spring-webmvc-6.1.15.jar:6.1.15]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:926) ~[spring-webmvc-6.1.15.jar:6.1.15]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:831) ~[spring-webmvc-6.1.15.jar:6.1.15]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-6.1.15.jar:6.1.15]
...
... 145 more
问题描述
@JSONField(format="xxxxx") 对http请求对象的LocalDateTime字段不生效!!!
我感觉是:下图中,第40行和第63行代码对
yyyyMMddhhmmss19
属性进行判断是多余的,删除掉应该就好了。理论上代码应该执行第41行才对。环境信息
重现步骤
基于应用程序其他部分需要,
FastJsonHttpMessageConverter
的默认格式设置为 "yyyy-MM-dd HH:mm:ss.SSS"config.setDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
某个 HTTP Request 对象的输入格式设置为 "yyyy-MM-dd HH:mm:ss"
期待的正确结果
@JSONField(format="xxxxx") 对http请求对象的LocalDateTime字段生效!
The text was updated successfully, but these errors were encountered: