Method failed for object 异常

来源:互联网 发布:青岛seo网络优化 编辑:程序博客网 时间:2024/05/03 03:23

今天遇到的异常:

ognl.MethodFailedException: Method "findAll" failed for object com.itheima.web.action.CustomerAction

这里写图片描述

最后检查出来是因为实体类的映射文件里,主键id后面多加了一个“>”号。

这里写图片描述

前面异常看了不知道问题在哪,后面异常没仔细看:

root causeorg.hibernate.boot.InvalidMappingException: Could not parse mapping document: com/itheima/domain/CstCustomerEntity.hbm.xml (RESOURCE)

root causeorg.hibernate.boot.MappingException: Unable to perform unmarshalling at line number 16 and column 13. Message: cvc-complex-type.2.3: 元素 'class' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。 : origin(com/itheima/domain/CstCustomerEntity.hbm.xml)

root causejavax.xml.bind.UnmarshalException - with linked exception: - [org.xml.sax.SAXParseException; lineNumber: 16; columnNumber: 13; cvc-complex-type.2.3: 元素 'class' 必须不含字符 [子级], 因为该类型的内容类型为“仅元素”。]

其实上面三段异常看了的话,可以很快确定错误出在实体类的映射文件上面。

阅读全文
0 0
原创粉丝点击