且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

当数据正确显示时,为什么在此 Spring MVC Web 应用程序中出现 Hibernate LazyInitializationException?

更新时间:2023-01-15 12:05:07

我只是猜测,但从堆栈跟踪来看,似乎在 SearchRule 上调用了 toString.SearchRule 是否有任何可能尚未加载的子对象?如果 SearchRule.toString 试图获取可能导致 LazyInitializationException 的未初始化子对象的值.

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.