Java8时间序列化异常
Java 8 date/time type java.time.YearMonth not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: cn.aiarch.common.forest.request.PowerRequest["monthTime"])
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type java.time.YearMonth not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: cn.aiarch.common.forest.request.PowerRequest["monthTime"])
Forest版本1.5.33
spring boot3.1.6
// 已经这么配置了,但是还是报上面的错
@Bean
public ForestJsonConverter forestJsonConverter() {
ForestJacksonConverter forestJacksonConverter = new ForestJacksonConverter();
ObjectMapper mapper = forestJacksonConverter.getMapper();
mapper.findAndRegisterModules();
return forestJacksonConverter;
}
添加maven依赖: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 问题说的很清楚了
@witt-bit 我肯定是保证所有依赖都没问题才会来这边提问题,com.fasterxml.jackson.datatype:jackson-datatype-jsr310一直都在项目之中。这个低级错误我还是不会犯的。
@witt-bit 我肯定是保证所有依赖都没问题才会来这边提问题,com.fasterxml.jackson.datatype:jackson-datatype-jsr310一直都在项目之中。这个低级错误我还是不会犯的。
pom.xml贴一下