spring - Springboot Hibernate Jackson version incompatibility -


hi starting project spring boot use hibernate persistence , expose rest api. have class(category) has lazy loaded array of class(items) when trying serialize array of categories following exception:

com.fasterxml.jackson.databind.jsonmappingexception:  org.hibernate.internal.sessionimpl cannot cast  javax.persistence.entitymanager (through reference chain:  java.util.arraylist[0]->com.checkout.model.category["items"]) 

i checked hibernate version 5.0.12 getting loaded through gradle "io.spring.dependency-management" plugin. jackson version 2.8.9 loaded automaticaly , springboot version using 1.5.6.release

checking sessionimpl int hibernate version not implement entitymanger, in latter version does, think version problem, not know version should using , how proper way specify versions springboot plugin determines other versions...

my build.gradle:

buildscript { ext {         springbootversion = '1.5.6.release'     }     repositories {         mavencentral()     }     dependencies {         classpath("org.springframework.boot:spring-boot-gradle-plugin:${springbootversion}")         classpath 'org.springframework:springloaded:1.2.6.release'     } }  apply plugin: 'java' apply plugin: 'idea' apply plugin: 'org.springframework.boot' apply plugin: 'io.spring.dependency-management'  version = '0.0.1-snapshot' sourcecompatibility = 1.8  repositories {     mavencentral() }  dependencies {     compile("org.springframework.boot:spring-boot-starter-web")     compile("org.springframework.boot:spring-boot-starter-data-jpa")     compile("mysql:mysql-connector-java:6.0.5")     compile("com.google.cloud.sql:mysql-socket-factory-connector-j-6:1.0.2")     compile("com.fasterxml.jackson.datatype:jackson-datatype-hibernate5") } 


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -