1.可能是因为映射文件( Order.hbm.xm)配置的class路径出错

  1. <hibernate-mapping>
  2. <class name="com.web.bean.Order" table="order">
  3. <id name="orderId" type="java.lang.Integer" column="order_id">
  4. <generator class="increment"></generator>
  5. </id>
  6. <property name="price" type="double" column="order_price" length="12"></property>
  7. <property name="quantity" type="int" column="order_quantity"></property>
  8. <property name="date" type="date" column="date" length="10"></property>
  9. <many-to-one name="seller" column="seller_id" class="com.web.bean.Seller"
  10. not-null="true">
  11. </many-to-one>
  12. <many-to-one name="phone" column="phone_id" class="com.web.bean.Phone"
  13. not-null="true">
  14. </many-to-one>
  15. <many-to-one name="customer" column="customer_id" class="com.web.bean.Customer"
  16. not-null="true">
  17. </many-to-one>
  18. </class>
  19. </hibernate-mapping>

类的路径必须写全,或者在<hibernate-mapping>中加上属性package="com.web.bean"

2.如果以上检查都是对的,那么就看applicationContext.xml中是否加上了 
<value>com/web/bean/Order.hbm.xml</value>

    1. <property name="mappingResources">
    2. <list>
    3. <value>com/web/bean/Customer.hbm.xml</value>
    4. <value>com/web/bean/Seller.hbm.xml</value>
    5. <value>com/web/bean/Brand.hbm.xml</value>
    6. <value>com/web/bean/Kind.hbm.xml</value>
    7. <value>com/web/bean/Order.hbm.xml</value>
    8. <value>com/web/bean/Phone.hbm.xml</value>
    9. <value>com/web/bean/SellerOwnPhone.hbm.xml</value>
    10. </list>
    11. </property>

nested exception is org.hibernate.MappingException解决方案的更多相关文章

  1. spring 整合hibernate注解时候,出现“Unknown entity: com.ssh.entry.Admin; nested exception is org.hibernate.MappingException: Unknown entity: com.ssh.entry.Admin”异常的问题

    今天学习使用ssh框架的时候,出现一个异常,弄了好久才找到,在这记录一下,我的sb错误1.spring整合hibernate,取代*.hbm.xml配置文件   在applicationContext ...

  2. Spring Boot启动 Unable to build Hibernate SessionFactory; nested exception is org.hibernate.MappingException: Could not instantiate id generator错误

    开始运行得很好的项目,因为前一天高度了项目结构和名称突然报上面的错误 查了很多网上资料很多解决方案 造成这个错误的原因有很多,例如 1.@Entity 类有变动,无非正常生成对应的数据库. 解决:使用 ...

  3. org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist: sys.entity.Role; nested exception is org.hibernate.PersistentObjectException: 的解决方案

    1.错误信息 org.springframework.dao.InvalidDataAccessApiUsageException: detached entity passed to persist ...

  4. org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query

    原因: 这个问题的解决方案很简单,主要是因为数据库中不存在相关的表或者列. org.springframework.dao.InvalidDataAccessApiUsageException: Pa ...

  5. nested exception is org.hibernate.QueryException: could not resolve property

    SSH框架出现了下面的错误: nested exception is org.hibernate.QueryException: could not resolve property 检查了hbm.x ...

  6. Invocation of init method failed; nested exception is org.hibernate.HibernateException: could not instantiate RegionFactory [org.hibernate.cache.impl

    严重: Exception sending context initialized event to listener instance of class org.springframework.we ...

  7. HTTP Status 500 - Request processing failed; nested exception is org.hibernate.exception.GenericJDBCException: could not execute statement

    1.什么操作出现:当我在项目中添加产品或者修改时,浏览器出现HTTP Status 500 - Request processing failed; nested exception is org.h ...

  8. org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.exception.JDBCConnectionException: Cannot open con

    org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session f ...

  9. Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable t

    spring与hibernate整合然后出现如下错误: org.springframework.beans.factory.BeanCreationException: Error creating ...

随机推荐

  1. 关于c.toArray might (incorrectly) not return Object[] (see 6260652)的问题解答

    最近学习jdk1.8源码时,发现ArrayList(Collection<? extends E> c)这个构造函数中,有句有意思的描述:c.toArray might (incorrec ...

  2. 最新二进制安装部署kubernetes1.15.6集群---超详细教程

    00.组件版本和配置策略 00-01.组件版本 Kubernetes 1.15.6 Docker docker-ce-18.06.1.ce-3.el7 Etcd v3.3.13 Flanneld v0 ...

  3. net.sf.json JSONObject与JSONArray使用实例

    实例自己想的一个实例应用场景:一个人可以有多个角色,例如:在家中是儿子,在学校是学生,在公司是程序员,一个人还可以办好多业务 * 每个业务好多个人都可以办,则标记(mark)就是记录这唯一标识的(如i ...

  4. Windows API 第21篇 DeleteVolumeMountPoint 删除挂载点

    函数原型:BOOL DeleteVolumeMountPoint(                                                      LPCTSTR lpszV ...

  5. python中defaultdict方法的使用

    默认值可以很方便 众所周知,在Python中如果访问字典中不存在的键,会引发KeyError异常(JavaScript中如果对象中不存在某个属性,则返回undefined).但是有时候,字典中的每个键 ...

  6. List -- 循环操作

    1,单元循环 for…in 2,索引循环 for…in range(len(List)) 3,同时循环单元和索引 使用enumerate: for index, item in enumerate(L ...

  7. 最小费用最大流——EK+SPFA

    终于把最小费用最大流学会了啊-- 各种奇奇怪怪的解释我已经看多了,但在某些大佬的指点下,我终于会了. 原来是个好水的东西. 最小费用最大流是什么? 不可能不知道网络流吧?如果不知道,自行百度去-- 费 ...

  8. 线性基(模板) LUOGU 3812

    题面 解题思路 线性基,是构造出一组数:ax,ax-1-.a1,ax的二进制最高位为x.这些数字能异或和可以表示原来所有数的异或和.其实相当于一个高斯消元的过程.所以我们按位枚举,如果这一位曾经没数, ...

  9. vue.js_11_路由的2中参数传递和路由的嵌套

    1.以?的形式传递参数   <router-link to="/login?id=10&name=zs">登录</router-link> 发送参数 ...

  10. Extjs 疑难杂症 (LoadMark 遮罩、Panel Update无效、chrome浏览器date控件全屏)

    一.在extjs gridPanel中使用LoadMark无效,三步搞定. 原代码: grid = new Ext.grid.GridPanel({ store: store, title:'资料列表 ...