Why am I getting a Hibernate LazyInitializationException in this Spring MVC web application when the data displays correctly?

后端 未结 6 421
太阳男子
太阳男子 2020-12-29 11:31

I am attempting to create a web application using Spring MVC, with Hibernate as its ORM layer. However, due to my inexperience with both frameworks I\'m struggling.

6条回答
  •  無奈伤痛
    2020-12-29 11:53

    I am just guessing but from the stack trace it seems that toString is being called on SearchRule. Does SearchRule have any child objects that may not have been loaded? If SearchRule.toString was trying to get the value for an uninitialised child object that could result in the LazyInitializationException.

提交回复
热议问题