错误:
Error 500: null
Servlet:
URI:
Exception Message: failed to lazily initialize a collection of role: Student.lockers, no session or session was closed
Caused by: Error executing tag <g:render>: Error executing tag <g:link>: failed to lazily initialize a collection of role: com.itzik.User.carts, no session or session was closed at grails-app/views/shared/_navigation.gsp:18 at grails-app/views/layouts/home.gsp:26
所以我有一个学生(有很多储物柜)。现在,当学生登录时,安全服务会处理将他们放入会话中。然后我的主控制器检查他们是否有一个活动的储物柜。如果不是,它会为他们创建一个。现在由于某种原因,它在 Student -> Locker 的关系上令人窒息。