org.hibernate.LazyInitializationException

org.hibernate.LazyInitializationException:failedtolazilyinitializeacollectionofrole:c... org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: com.bdyd.vo.Item.subitems - no session or session was closed
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:191)
org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:183)
org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:48)
org.hibernate.collection.PersistentSet.iterator(PersistentSet.java:134)
org.apache.taglibs.standard.tag.common.core.ForEachSupport.toForEachIterator(ForEachSupport.java:348)
org.apache.taglibs.standard.tag.common.core.ForEachSupport.supportedTypeForEachIterator(ForEachSupport.java:224)
org.apache.taglibs.standard.tag.common.core.ForEachSupport.prepare(ForEachSupport.java:155)
javax.servlet.jsp.jstl.core.LoopTagSupport.doStartTag(LoopTagSupport.java:256)
org.apache.jsp.jsp.index_jsp._jspx_meth_c_005fforEach_005f1(index_jsp.java:580)
org.apache.jsp.jsp.index_jsp._jspx_meth_c_005fforEach_005f0(index_jsp.java:541)
org.apache.jsp.jsp.index_jsp._jspService(index_jsp.java:148)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:390)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
com.bdyd.filter.EncodingFilter.doFilter(EncodingFilter.java:33)
展开
 我来答
粟舟
2008-11-29 · 超过29用户采纳过TA的回答
知道答主
回答量:65
采纳率:100%
帮助的人:59.3万
展开全部
配置有问题,把hibernate里面的那个:.hbm.xml文件中,配置lazy=false;
这是由于lazy而产生的错误,
lazy默认是true
<class name="" table="" lazy="false">
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式