JsonMappingException: could not initialize proxy - no Session

后端 未结 4 1309
小鲜肉
小鲜肉 2020-12-03 02:01

I am building a RESTful Web Service that consumes and returns JSON. I am encountering the following stack trace when I try to fetch an ESRBRating object from the database th

4条回答
  •  孤城傲影
    2020-12-03 02:46

    Solved for Spring Boot 2.3.0 by adding to gradle.build:

    implementation 'com.fasterxml.jackson.datatype:jackson-datatype-hibernate5:2.11.3'

    And declaring one more bean:

    @Bean
    public Module datatypeHibernateModule() {
        return new Hibernate5Module();
    }
    

提交回复
热议问题