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. 20-iframe

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. css 阴影设置box-shadow

    box-shadow: 1px 2px 5px 6px #888888 inset 1px: 必须,水平阴影的位置, 负值为左 2px: 必须,垂直阴影的位置, 负值为上; 5px: 可选,模糊距离; ...

  3. 2019-4-16-C#-使用反射获取私有属性的方法

    title author date CreateTime categories C# 使用反射获取私有属性的方法 lindexi 2019-4-16 10:13:3 +0800 2018-09-26 ...

  4. gitlab merge request

    分支提了mr之后, 又有commit 不用重新提mr,mr中会自动更新 要保证项目下的.git目录中有hooks这个目录(如果是从github迁移到gitlab的项目, 可能没有这个目录, 导致mr不 ...

  5. jeecms 配置可以低级别用户流程

    使用管理员admin登录后台,进入用户—>管理员(本站)à添加,填写用户名.密码等信息,如下图: 需要注意几个权限控制的问题: 1,  等级,值越大等级越高,等级高的管理员可以审核等级低的管理员 ...

  6. mysql innodb 的 逻辑存储结构

    如上图: innodb 的 逻辑存储单元分成 表空间,段,区,页 4个等级 默认情况下,一个数据库 所有变共享一个 默认的表空间(tablespan).可以指定每个表一个表空间. 一个表空间管理着 多 ...

  7. Windows 10专业版激活(附激活码)

    安全密钥:BT6TH-FN8VP-6WGCK-6BM9R-MWRDB(使用有效,在物理机,虚拟机都激活了一次) 六一八期间自己买了配件第一次组了台式机,系统是在123pe下的原版win10,装好机器之 ...

  8. Java中String类的常见面试题

    1. 判断定义为String类型的s1和s2是否相等 String s1 = "ab"; String s2 = "abc"; String s3 = s1 + ...

  9. Python Flask高级编程之从0到1开发《鱼书》精品项目

    Python Flask高级编程之从0到1开发<鱼书>精品项目     整个课程都看完了,这个课程的分享可以往下看,下面有链接,之前做java开发也做了一些年头,也分享下自己看这个视频的感 ...

  10. VC++1.5太伟大了

    功能样样俱全,一点不比现在的VS系列差 VC++1.5全貌,虽然很古老,但是已经可以了. 新建的文档试图,多文档工程,很像样 文档试图,单文档工程,已经非常像样了,和记事本差不多了 这是资源编辑器,寒 ...