JSONException: org.hibernate.LazyInitializationException In Spring struts hibernate application

后端 未结 2 614
情话喂你
情话喂你 2020-12-18 12:48

I\'m getting above explain error and done some research and found that org.springframework.orm.hibernate4.support.OpenSessionInViewFilter is solution. But its n

2条回答
  •  星月不相逢
    2020-12-18 13:35

    As Error Said

    21:56:35,526 ERROR [org.apache.struts2.dispatcher.Dispatcher] (http-/127.0.0.1:8080-1) Exception occurred during processing request: org.apache.struts2.json.JSONException: org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.ast.domain.admin.AtOrganisation.atDivisions, could not initialize proxy - no Session: 
    

    This is because hibernet is not able to fetch data from database due to lazy="false". For that you have have to use

    lazy="false" fetch="join" at atDivisions

    com.ast.domain.admin.AtOrganisation.atDivisions

提交回复
热议问题