[Bug] Java 8 date/time type java.time.ZonedDateTime
not supported by default
#588
Labels
bug 🐞
Something isn't working
java.time.ZonedDateTime
not supported by default
#588
Search before asking
AREX Test Service
AREX Java Agent (arextest/arex-agent-java)
Current Behavior
在录制的时候,agent报如下错误:
[[title=arex.serializer-serialize]]cccc-->can not serialize object: org.springframework.http.ResponseEntity-com.tencent.gms.gms.web.rest.vm.usermanagement.SimpleUserVM, serializer: null, cause: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type
java.time.ZonedDateTime
not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: org.springframework.http.ResponseEntity["body"]->com.tencent.gms.web.rest.RespResult["timestamp"])Expected Behavior
能够正常序列化
Steps To Reproduce
在arex-agent 的源码(版本0.4.6)中新建一个类,代码参考如下:
执行这个main方法就会报错
怀疑bug发生的地方: https://github.com/arextest/arex-agent-java/blob/main/arex-instrumentation-foundation/src/main/java/io/arex/foundation/serializer/jackson/JacksonSerializer.java 第88行
需要添加
MAPPER.registerModule(new JavaTimeModule());
这个JavaTimeModule 来自于com.fasterxml.jackson.datatype.jsr310
依赖大概长这样:
Anything else
No response
Are you willing to submit a pull request to fix on your own?
The text was updated successfully, but these errors were encountered: