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. JS基础语法之DOM02(事件)

    1.常用事件 1.onclick 单击 应用场景:为按钮绑定 2.ondbclick 双击 3.onfocus   获得焦点 4.onblur 失去焦点 应用场景:用于表单验证,用户离开某个输入框时, ...

  2. Django项目: 4.用户登录登出功能

    用户登录登出功能 一.功能需求分析 1. 登录退出功能分析 流程图 功能 登录页面 登录功能 退出功能 二.登录页面 1. 接口设计 接口说明 类目 说明 请求方法 GET url定义 /user/l ...

  3. Gym-102141E

    https://vjudge.net/problem/Gym-102141E 用set乱搞 #include<iostream> #include<cstdio> #inclu ...

  4. 自动化运维工具Ansible工具

    目录 一.初识Ansible 二.Ansible的架构 三.Ansible基础使用 安装 主机清单 管理主机 四.Ansible用脚本管理主机 五.Ansible模块Module 六.Ansible常 ...

  5. Ionic 生成icon图标

    1.直接切换到项目跟目录 运行以下命令 备注:运行第一次ionic rescoures 后自动生成文件夹rescoures ,让后帮你自己的icon.png 文件放进入就ok ,在次运行ionic r ...

  6. 深入浅出 Java Concurrency (5): 原子操作 part 4[转]

    在JDK 5之前Java语言是靠synchronized关键字保证同步的,这会导致有锁(后面的章节还会谈到锁). 锁机制存在以下问题: (1)在多线程竞争下,加锁.释放锁会导致比较多的上下文切换和调度 ...

  7. hibernate4注解字段为mysql的text

    文章的正文detail就需要设置为text 在getter方法上添加注解 @Lob @Basic(fetch = FetchType.LAZY) @Type(type = "text&quo ...

  8. DVWA 之high级别sql注入

                 Sqlmap 高级注入,抓包,然后保存数据到1.txt 1.判断注入点 sqlmap -r /root/1.txt -p id --second-order "ht ...

  9. Navicat12激活,最新版本v12.1.18,原版激活[windows]

    1.navicat_premium原版安装包  :官网下载地址2.注册工具  :github地址 本次用到的软件我已经打包好  :    蓝奏云 我安装navicat的路径在:I:\Navicat P ...

  10. nodejs+express 初学(二)

    开发首先要先选一个适合的IDE,经过上网查找最后还是决定用Webstorm,因为比较好用 1.我下载的版本是 2.然后就是新创建一个nodejs项目了 3.确定后就会在项目中生成新的项目,结构如下 目 ...