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. python学习笔记3.3_json解析

    一.json文件读取 源文件:exampl.json 二.json在线解析 常用网站:https://www.json.cn/  三.数据导出为json格式文件

  2. js for in 和 for of 的区别

    引自:http://es6.ruanyifeng.com/#docs/iterator for...of循环可以代替数组实例的forEach方法. const arr = ['red', 'green ...

  3. RTNETLINK answers: File exists错误解决方法

    >一.写在前面: 因为是我刚学习linux好多问题需要解决,bolg仅作为记录自己的在技术这条道路上的点点滴滴. 二.事件起因: 最近因为女友的原因消沉的好长时间,在马哥那里的课程的结束到现在已 ...

  4. 服务器的tomcat调优和jvm调化

    下面讲述的是tomcat的优化,及jvm的优化 Tomcat 的缺省配置是不能稳定长期运行的,也就是不适合生产环境,它会死机,让你不断重新启动,甚至在午夜时分唤醒你.对于操作系统优化来说,是尽可能的增 ...

  5. HBase功能组件

  6. javascript执行上下文和变量对象

    执行上下文(execution context): 执行上下文就是当前 JavaScript 代码被解析和执行时所在环境的抽象概念. js语言是一段一段的顺序执行,这个“段”其实就是我们说的这个执行上 ...

  7. javascript 解析ajax返回的xml和json格式的数据

    写个例子,以备后用 一.JavaScript 解析返回的xml格式的数据: 1.javascript版本的ajax发送请求 (1).创建XMLHttpRequest对象,这个对象就是ajax请求的核心 ...

  8. 联想 Z470个人安装黑苹果参考

    笔记本是联想 Z470,cpu i3-2350M 傻瓜图文式]Win系统下制作U盘CLOVER引导 EDIT部分 进去黑屏 U盘引导盘

  9. Ubuntu时间管理方法

    1. date 命令主要用于显示以及修改系统时间 2. hwclock 命令用于查看设置硬件时间,以及同步硬件时间与系统时间 # 显示硬件时间hwclock # 设置硬件时间hwclock -set ...

  10. webapp中<meta>与css代码部署

    1.页面头部标签申明 <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml" id="te ...