问题与解析;
1.org.hibernate.MappingNotFoundException:原因是没有对spring容器进行实例化,可以在web.xml中进行配置.
2. org.hibernate.PropertyNotFoundException: field [commend] not found on com.lyq.model.product.ProductInfo
这个异常是在hibernate的映射文件中(*.hbm.xml)的属性值拼写错误,一定要仔细检查,数据库中的字段和JavaBean中的属性值是否相同.JavaBean中的属性的get和set方法是否正确.还有映射文件中的属性值和以上两个属性值是否一致,注意不要有空格.上面的.
上面的异常就是 JavaBean中的commend拼写错误而导致的.
3.org.hibernate.MappingException:Could not determine type for
原因是*.hbm.xml文件中的type属性值要用小写的.太马虎了.
4.org.apache.jasper.JasperException: /WEB-INF/pages/common/head.jsp (line: 1, column: 2) Page directive: illegal to have multiple occurrences of contentType with different values (old: text/html; charset=utf8, new: text/html; charset=UTF-8)
原因是在页面中使用了<%@ include file="">包含了另一个页面,两个页面顶端的page属性中的内容不同导致的.
如:页面1: <%@ page language="java" contentType="text/html; charset=utf8" pageEncoding="utf8"%>
页面2: <%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
以上例子中charset属性前一个有空格,一个没空格,其值也是一个大写一个小写,这些都会导致这个异常.