jackson-datatype-hibernate icon indicating copy to clipboard operation
jackson-datatype-hibernate copied to clipboard

Still getting LazyInitialization Exception

Open RaviMovva opened this issue 10 years ago • 2 comments

Hi ,

I have integrated jackson-datatype-hibernate version 2.3.3 into my application. I am using spring MVC 3.2 and hibernate 3.6.

My Controller returns a User Object that has few String Fields , and collections defined in it .

The ManyToMany relationships on the collections in User (hibernate Entity) have been mentioned to use lazy fetch stratergy.

My expectation was using this module jackson can serialize the entire user object including the collections while generating the JSON, But instead I am still getting LazyInitializtion Exception.

Any help would be appreciated.

Regards, Ravi

RaviMovva avatar Jun 03 '14 14:06 RaviMovva

check your dependency version

    <dependency>
        <groupId>com.fasterxml.jackson.datatype</groupId>
        <artifactId>jackson-datatype-hibernate4</artifactId>
        <version>2.4.1</version>
    </dependency>

srikanthmalyala avatar Jul 29 '14 16:07 srikanthmalyala

Relevant : https://github.com/FasterXML/jackson-datatype-hibernate/pull/58

eoger avatar Aug 06 '14 16:08 eoger