Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java8时间序列化异常 #182

Open
ShidaYuumi opened this issue Dec 26, 2023 · 2 comments
Open

Java8时间序列化异常 #182

ShidaYuumi opened this issue Dec 26, 2023 · 2 comments

Comments

@ShidaYuumi
Copy link

ShidaYuumi commented Dec 26, 2023

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;
    }
@ShidaYuumi ShidaYuumi changed the title Java8时间序列化一场 Java8时间序列化异常 Dec 26, 2023
@witt-bit
Copy link
Contributor

添加maven依赖: com.fasterxml.jackson.datatype:jackson-datatype-jsr310 问题说的很清楚了

@ShidaYuumi
Copy link
Author

@witt-bit 我肯定是保证所有依赖都没问题才会来这边提问题,com.fasterxml.jackson.datatype:jackson-datatype-jsr310一直都在项目之中。这个低级错误我还是不会犯的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants