org.hibernate.ObjectNotFoundException异常一则

发表于: java/j2ee | 作者: | 日期: 2012/4/26 05:04

收到如下异常:


Caused by: javax.el.ELException: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.darkmi.entity.system.Company#0]
at javax.el.BeanELResolver.getValue(BeanELResolver.java:298)
at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
at com.sun.el.parser.AstValue.getValue(AstValue.java:138)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:206)
at org.apache.jasper.runtime.PageContextImpl.evaluateExpression(PageContextImpl.java:1001)
at org.apache.jsp.WEB_002dINF.content.system.user_jsp._jspx_meth_s_iterator_0(org.apache.jsp.WEB_002dINF.content.system.user_jsp:1166)
at org.apache.js

出现以上异常,检测关联字段是否有问题,比如为空或没有与之关联的记录。

既然有外键引用就把外键约束加上,不要偷懒,有了外键约束就不会出现以上问题。

: https://blog.darkmi.com/2012/04/26/2227.html

本文相关评论 - 1条评论都没有呢
Post a comment now » 本文目前不可评论

No comments yet.

Sorry, the comment form is closed at this time.